Skip to content

v1.0.16

Latest

Choose a tag to compare

@debabin debabin released this 25 Aug 09:53
· 1 commit to main since this release

Hook fixes

This release adds success/error callbacks to useImage and prevents useTimeout from starting when the delay is empty.

Fixes

  • useTimeout — the timeout no longer starts when delay is undefined or 0. The delay parameter is now optional, so useTimeout(callback) is valid and stays idle until a positive delay is provided.

Changes

  • useImage — added onSuccess and onError options, matching the callback style used by useQuery. onSuccess is called with the loaded HTMLImageElement, and onError is called with an Error. The returned error value is now also an Error instead of the raw image error event.