react-timing-hooks
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [3.1.0](https://github.com/EricLambrecht/react-timing-hooks/compare/v3.0.0...v3.1.0) (2022-12-09) | ||
### Features | ||
* **timeout:** Allow manual clearance of timeouts ([8a589b8](https://github.com/EricLambrecht/react-timing-hooks/commit/8a589b8ec78eb7fb9f536289993471171d353322)), closes [#28](https://github.com/EricLambrecht/react-timing-hooks/issues/28) | ||
## [3.0.0](https://github.com/EricLambrecht/react-timing-hooks/compare/v2.2.3...v3.0.0) (2022-12-09) | ||
@@ -7,0 +14,0 @@ |
@@ -8,2 +8,3 @@ import { useRef, useCallback, useEffect, useState } from 'react'; | ||
timeoutIds.current.push(id); | ||
return id; | ||
}, [timeoutIds]); | ||
@@ -50,2 +51,3 @@ useEffect(() => { | ||
setTimeoutId(id); | ||
return id; | ||
}, [timeout]); | ||
@@ -52,0 +54,0 @@ } |
@@ -12,2 +12,3 @@ 'use strict'; | ||
timeoutIds.current.push(id); | ||
return id; | ||
}, [timeoutIds]); | ||
@@ -54,2 +55,3 @@ react.useEffect(() => { | ||
setTimeoutId(id); | ||
return id; | ||
}, [timeout]); | ||
@@ -56,0 +58,0 @@ } |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
/** | ||
@@ -5,3 +6,3 @@ * @param callback The callback that is invoked after the timeout expired | ||
*/ | ||
declare function useTimeout<T extends (...args: never[]) => unknown>(callback: T, timeout: number): (...args: Parameters<T>) => void; | ||
declare function useTimeout<T extends (...args: never[]) => unknown>(callback: T, timeout: number): (...args: Parameters<T>) => NodeJS.Timeout | number; | ||
export default useTimeout; |
{ | ||
"name": "react-timing-hooks", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "React hooks for setTimeout, setInterval, requestAnimationFrame, requestIdleCallback", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38719
457