v1.0.7
Improve async and connection hooks
This release improves retry handling across async hooks, makes polling and reconnection more flexible, and adds constraint control to the device list hook.
Features
useQuery— reworked the retry logic soretrynow accepts a function(failureCount, error) => booleanin addition to a boolean or number, letting you decide whether to retry based on the failure count or the error itself.useQuery— updatedrefetchIntervalto accept a function returning the next interval, orfalseto stop polling, enabling conditional polling that ends once a condition is met.useWebSocket— reworked the retry logic soretrynow accepts a function(failureCount, event) => booleanin addition to a boolean or number, giving full control over reconnection based on the failure count or the close event.useWebSocket— added theimmediatelyoption to control whether the connection opens on mount, allowing the socket to be opened manually throughopen()when set tofalse.useWebSocket— renamed theonDisconnectedcallback toonCloseto align with the native WebSocket close event.useDeviceList— added support for defaultconstraintsthrough options and per-call constraints throughtrigger(constraints), giving finer control over which permissions are requested when reading the device list.