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

react-timing-hooks

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-timing-hooks - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Changelog

### [0.1.1](https://github.com/EricLambrecht/react-timing-hooks/compare/v0.1.0...v0.1.1) (2019-11-08)
This release contains only documentation updates.
## [0.1.0](https://github.com/EricLambrecht/react-timing-hooks/compare/v0.1.0-alpha.6...v0.1.0) (2019-11-08)

@@ -7,0 +11,0 @@

2

package.json
{
"name": "react-timing-hooks",
"version": "0.1.0",
"version": "0.1.1",
"description": "React hooks for creating timing-related effects (setTimeout, setInterval, requestAnimationFrame, requestIdleCallback)",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

# react-timing-hooks
This library contains (or will contain) a bunch of hooks that can be used to trigger effects
containing timeouts, intervals etc. without having to worry about storing "timeoutIds" or proper
clean up of leaking timers. Apart from that this lib is super light-weight, since it doesn't include
any other dependencies.
This package contains a bunch of hooks that allow you to make use of `setTimeout`,
`setInterval`, `setIdleCallback` and `requestAnimationFrame` in your react-components _without_
having to worry about handling "IDs" or the clean up of leaking timers etc. Apart from that
the hooks are quite easy to use.
**This package is still in alpha. It is not yet feature complete.**
Oh, and the lib is super light-weight, too, since it doesn't include any other dependencies!

@@ -29,4 +29,2 @@ #### TL;DR

**Note**: A hook for `requestAnimationFrame` and an interval-versions of `requestIdleCallback` is still in development
### `useTimeout(callback, timeout)`

@@ -54,2 +52,5 @@

This works like a regular `useEffect` hook, except that it adds a `setTimeout` like function
to the callback args.
Example:

@@ -122,2 +123,5 @@

This works like a regular `useEffect` hook, except that it adds a `requestIdleCallbackEffect` like function
to the callback args.
**Note:** This hook will print a warning if the browser doesn't support `requestIdleCallback`.

@@ -124,0 +128,0 @@

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