User inactivity #862
-
Hi, I searched on the documentation, but I didn't find anything about stop fetching when detect user inactivity (user stops to move their mouse during some time) Do you knows something about that? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
@joaovbibiano we're working on feature now to let user stop revalidations under specific condition. and the user inactivity detection will be implemented on user side since the condition is fully customized. will uodate the doc later once the new feature is released. |
Beta Was this translation helpful? Give feedback.
-
For those who need implent this, I would like to suggest a temporary solution like this
You can find the hook |
Beta Was this translation helpful? Give feedback.
-
swr@0.4.x is released with a new config const isIdle = useIdle(3e3);
useSWR(api, fetcher, {isPaused: () => isIdle}) |
Beta Was this translation helpful? Give feedback.
For those who need implent this, I would like to suggest a temporary solution like this
You can find the hook
useIdle
here https://github.com/streamich/react-use/blob/master/docs/useIdle.md