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

use-debounce

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-debounce - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

10

package.json
{
"name": "use-debounce",
"version": "0.0.7",
"version": "0.0.8",
"description": "Debounce hook for react",

@@ -26,4 +26,4 @@ "main": "lib/index.js",

"peerDependencies": {
"react": ">=16.7.0-alpha.0",
"react-dom": ">=16.7.0-alpha.0"
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},

@@ -39,5 +39,5 @@ "homepage": "https://github.com/xnimorz/use-debounce#readme",

"jest": "^23.6.0",
"react": "^16.7.0-alpha.0",
"react-dom": "^16.7.0-alpha.0"
"react": "^16.8.0",
"react-dom": "^16.8.0"
}
}

@@ -6,16 +6,13 @@ import { useState, useEffect } from 'react';

useEffect(
() => {
const handler = setTimeout(() => {
setDebouncedValue(value);
}, delay);
useEffect(() => {
const handler = setTimeout(() => {
setDebouncedValue(value);
}, delay);
return () => {
clearTimeout(handler);
};
},
[value, delay]
);
return () => {
clearTimeout(handler);
};
}, [value, delay]);
return debouncedValue;
};

Sorry, the diff of this file is not supported yet

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