Summary
usePolling in packages/data/src/hooks/usePolling.ts supports pause(), but the effect always calls execute() immediately when interval, options.adaptive, or a dependency changes. That immediate execution does not check pausedRef.
Reproduction
- Render usePolling(fn, 1000, [dep]).
- Call pause().
- Re-render with a changed dep or interval.
- Observe that n is invoked even though the hook is paused.
Expected behavior
While paused, dependency changes should update the polling configuration without starting a new request until
esume() or an explicit
efresh() call.
Actual behavior
The effect rerun calls execute() unconditionally, so a paused poller can still fire network or system calls.
Summary
usePolling in packages/data/src/hooks/usePolling.ts supports pause(), but the effect always calls execute() immediately when interval, options.adaptive, or a dependency changes. That immediate execution does not check pausedRef.
Reproduction
Expected behavior
While paused, dependency changes should update the polling configuration without starting a new request until
esume() or an explicit
efresh() call.
Actual behavior
The effect rerun calls execute() unconditionally, so a paused poller can still fire network or system calls.