- Fixes an issue updating state from inside onIdle (see #71)
- Added a typescript definition that will now be maintained along with this library. It expects that you have the react type definitions installed.
- Fixed a documentation error
Version 4.2.0 will now dynamically bind and unbind events.
Events are unbound when:
stopOnIdleis set totrueand the user goes idlepause()is called
Events are bound when:
- component is mounted
reset()is calledresume()is called
stopOnIdlewill now keepIdleTimerin idle state untilreset()is called
- Fixes a bug where
stopOnIdlelogic was being applied to active state
- Fixes a bug where initial
onIdleevent was not firing whenstopOnIdleis set
Version 4.1.0 adds support for some commonly requested features:
- Added property
stopOnIdledefaults tofalse. Setting totruewill prevent user activity from restarting theIdleTimeronce it has gone idle. This useful if you want to do some custom async stuff before theIdleTimergets restarted. In order to restart theIdleTimercallreset()on your ref. - Added event handler
onActivewhich enables reporting of all user activity fromIdleTimer. The built indebounceorthrottleproperties will help increase performance if you are using theonActiveevent. By defaultdebounceandthrottleare off. Only one can be enabled at a time. - Added property
debouncedefaults to 0. Set theonActivedebounce delay in milliseconds. Thethrottleproperty cannot be set if this property is set. - Added property
throttledefaults to 0. Set theonActivethrottle delay in milliseconds. Thedebounceproperty cannot be set if this property is set.
- Fixes a memory leak when IdleTimer is unmounted. Events need to be removed exactly the same way they are added. See here
- Fixed a bug where passive and capture were not being passed to the event listener. The function has been reformated so it reads better.
- Fixed some inconsistencies in the README
- Added default prop values to documentation
- Fixes a bug where setting
startOnMounttofalsestarts IdleTimer in the wrong state
- Fixes a bug where the module could not be imported
- Minor documentation updates
- Continuous integration bugfixes
Version 4.0 contains a rewrite of the build system and a refactor of the source code for IdleTimer. After accepting many pull requests, the projects code style was destroyed. We added in some forced styling and will not be accepting PRs that don't respect this style. Contribution guide now on the README.
- The property
startOnLoadhas been renamed tostartOnMountto make more sense in a react context. - The property
activeActionhas been renamed toonActive. - The property
idleActionhas been renamed toonIdle.
- Added passive property. Defaults to
true, bind events with passive mode enabled - Added capture property. Defaults to
true, bind events with capture mode enabled - Pass event through to
idleandactivehandler functions
- Fixed installation bug on windows machines. This was due to the use of environment variables in the build scripts. The new build system does not rely on environment variables defined at the cli level
We dropped support for date formatting in version 3. React idle timer returns raw date objects and you can use which ever library you like to format it. If you would like to continue using the built in formatter, stick with version 2.
- Removed built in date formatter.
Added support for isomorphic react!
Initial release