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 whendelayisundefinedor0. Thedelayparameter is now optional, souseTimeout(callback)is valid and stays idle until a positive delay is provided.
Changes
useImage— addedonSuccessandonErroroptions, matching the callback style used byuseQuery.onSuccessis called with the loadedHTMLImageElement, andonErroris called with anError. The returnederrorvalue is now also anErrorinstead of the raw image error event.