🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

react-useinterval

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-useinterval - npm Package Compare versions

Comparing version

to
1.0.2

@@ -1,1 +0,1 @@

"use strict";var react=require("react");function useInterval(e,r){for(var t=arguments.length,n=new Array(t>2?t-2:0),u=2;u<t;u++)n[u-2]=arguments[u];var a=react.useRef();react.useEffect(function(){a.current=e},[e]),react.useEffect(function(){if(null!=r){var e=setInterval(function(){a.current.apply(a,n)},r);return function(){return clearInterval(e)}}},[r])}module.exports=useInterval;
"use strict";var r=require("react");module.exports=function(e,t){for(var n=[],u=2;u<arguments.length;u++)n[u-2]=arguments[u];var c=r.useRef();r.useEffect((function(){c.current=e}),[e]),r.useEffect((function(){if(null!=t){var r=setInterval((function(){c.current&&c.current.apply(c,n)}),t);return function(){return clearInterval(r)}}}),[t])};
{
"name": "react-useinterval",
"version": "1.0.1",
"version": "1.0.2",
"description": "A custom React hook that wraps setInterval",

@@ -8,6 +8,7 @@ "license": "MIT",

"repository": {
"type" : "git",
"url" : "https://github.com/johndiiorio/react-useinterval"
"type": "git",
"url": "https://github.com/johndiiorio/react-useinterval"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {

@@ -23,15 +24,14 @@ "build": "rollup -c"

"peerDependencies": {
"react": ">= 16.8.0 < 17"
"react": ">= 16.8.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"rollup": "^1.1.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-terser": "^4.0.3"
"@rollup/plugin-typescript": "^5.0.2",
"@types/react": "^16.9.46",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"rollup": "^2.26.3",
"rollup-plugin-terser": "^7.0.0",
"tslib": "^2.0.1",
"typescript": "^3.9.7"
}
}
}

@@ -35,3 +35,3 @@ [![npm version](https://img.shields.io/npm/v/react-useinterval.svg?style=flat)](https://www.npmjs.com/package/react-useinterval) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/johndiiorio/react-useinterval/blob/master/LICENSE)

const increaseCount = (amount = 1) => {
const increaseCount = amount => {
setCount(count + amount);

@@ -38,0 +38,0 @@ };

Sorry, the diff of this file is not supported yet