We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df5b2b8 commit cfc1672Copy full SHA for cfc1672
src/useIdleTimer.js
@@ -316,15 +316,15 @@ function useIdleTimer ({
316
// Create debounced action if applicable
317
if (debounce > 0) {
318
emitOnAction.current = debounced(onAction, debounce)
319
- }
320
321
// Create throttled action if applicable
322
- if (throttle > 0) {
+ } else if (throttle > 0) {
323
emitOnAction.current = throttled(onAction, throttle)
324
325
326
// No throttle or debounce
327
- emitOnAction.current = onAction
+ } else {
+ emitOnAction.current = onAction
+ }
328
}, [onAction])
329
330
return {
0 commit comments