Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

use-elapsed-time

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-elapsed-time - npm Package Versions

13

2.1.3

Diff

Changelog

Source

2.1.3 (May 29th, 2020)

Big fix:

  • SSR: use useEffect when environment is node or window is undefined. When the environment is browser useLayoutEffect should be used instead
  • Remove side effects from useState so React.StrictMode doesn't bug the hook in development
  • Add a test to ensure that timeout is cancelled when isPlaying is set to false when the duration is reached
vydimitrov
published 2.1.2 •

Changelog

Source

2.1.2 (May 18th, 2020)

Big fix:

  • Reset method will now ignore any none number value passed to it and it will use the previous startAt value
vydimitrov
published 2.1.1 •

Changelog

Source

2.1.1 (May 13th, 2020)

Implemented enhancements:

  • autoResetKey is a new prop that allows resetting the animation when the key changes. It works similar to React's key prop
vydimitrov
published 2.0.1 •

Changelog

Source

2.0.1 (May 12th, 2020)

Bug fix:

Fix an issue where resetting the animation once it was done when the isPlaying was set to true did not start playing after the reset

vydimitrov
published 2.0.0 •

Changelog

Source

2.0.0 (May 11th, 2020)

Breaking Changes:

  • The hook now returns an object with elapsedTime in seconds and reset method, like so { elapsedTime, reset }
  • durationSeconds is renamed to just duration. The duration is now set in seconds
  • startAt now expects value in seconds
  • onComplete will receive as an argument the totalElapsedTime in seconds. The animation can now be repeated by returning an object instead of an array. The object may have the following params: shouldRepeat indicates if the loop should start over; delay - delay before looping again in seconds; newStartAt set new start at value. |
  • Changing the duration while the loop is running will update the duration - if the new duration is more than the previous one, the measurement of the elapsed time will continue to the new duration; if the duration is less than the previous one, the onComplete callback will be fired.

Implemented enhancements:

  • options.shouldResetOnDurationChange can be set to reset elapsed time when the duration changes
  • the hook now returns reset method, which can be used to reset the elapsed time
vydimitrov
published 1.2.1 •

vydimitrov
published 1.2.0 •

vydimitrov
published 1.1.6 •

vydimitrov
published 1.1.5 •

Changelog

Source

1.1.5 (December 22nd, 2019)

Implemented enhancements:

  • Refactor internals
  • Add test coverage
vydimitrov
published 1.1.4 •

Changelog

Source

1.1.4 (December 19th, 2019)

Implemented enhancements:

  • Add a new config option "startAt" to change the start time of the animation. Defaults to 0 if not provided
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc