Closed drecali closed 2 years ago
Closes #287 Added the pointer event types below to the event prop for useIdleTimer or withIdleTimer.
event
useIdleTimer
withIdleTimer
I don't personally use all these events but according to MDN, it seems like they're all valid and supported.
pointerover pointerenter pointerdown pointermove pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture
I was using the workaround below to add more events on a per-project basis, but it may not be easy for all users to implement. I think it's easier if this library supports valid event types according to the W3C specs.
- import { useIdleTimer } from 'react-idle-timer'; + import { EVENTS, useIdleTimer } from 'react-idle-timer'; + const timerEvents = [ + 'pointerup', + 'pointermove' + ] as const; const { pause, resume, reset } = useIdleTimer({ element: document, timeout: 2000, - events: ['pointerup', 'pointermove'], + events: timerEvents as unknown as EVENTS[], });
Please let me know if I missed anything. Thanks again for maintaining such a useful library!
Someone is attempting to deploy a commit to a Personal Account owned by @SupremeTechnopriest on Vercel.
@SupremeTechnopriest first needs to authorize it.
Closes #287 Added the pointer event types below to the
event
prop foruseIdleTimer
orwithIdleTimer
.I don't personally use all these events but according to MDN, it seems like they're all valid and supported.
I was using the workaround below to add more events on a per-project basis, but it may not be easy for all users to implement. I think it's easier if this library supports valid event types according to the W3C specs.
Please let me know if I missed anything. Thanks again for maintaining such a useful library!