@restart/hooks
Advanced tools
Comparing version 0.4.14 to 0.4.15
@@ -5,3 +5,5 @@ import { Dispatch, SetStateAction } from 'react'; | ||
* Similar to `useState`, except the setter function is debounced by | ||
* the specified delay. | ||
* the specified delay. Unlike `useState`, the returned setter is not "pure" having | ||
* the side effect of scheduling an update in a timeout, which makes it unsafe to call | ||
* inside of the component render phase. | ||
* | ||
@@ -17,2 +19,2 @@ * ```ts | ||
*/ | ||
export default function useDebouncedState<T>(initialState: T, delayOrOptions: number | UseDebouncedCallbackOptions): [T, Dispatch<SetStateAction<T>>]; | ||
export default function useDebouncedState<T>(initialState: T | (() => T), delayOrOptions: number | UseDebouncedCallbackOptions): [T, Dispatch<SetStateAction<T>>]; |
@@ -10,3 +10,5 @@ "use strict"; | ||
* Similar to `useState`, except the setter function is debounced by | ||
* the specified delay. | ||
* the specified delay. Unlike `useState`, the returned setter is not "pure" having | ||
* the side effect of scheduling an update in a timeout, which makes it unsafe to call | ||
* inside of the component render phase. | ||
* | ||
@@ -13,0 +15,0 @@ * ```ts |
@@ -5,3 +5,5 @@ import { Dispatch, SetStateAction } from 'react'; | ||
* Similar to `useState`, except the setter function is debounced by | ||
* the specified delay. | ||
* the specified delay. Unlike `useState`, the returned setter is not "pure" having | ||
* the side effect of scheduling an update in a timeout, which makes it unsafe to call | ||
* inside of the component render phase. | ||
* | ||
@@ -17,2 +19,2 @@ * ```ts | ||
*/ | ||
export default function useDebouncedState<T>(initialState: T, delayOrOptions: number | UseDebouncedCallbackOptions): [T, Dispatch<SetStateAction<T>>]; | ||
export default function useDebouncedState<T>(initialState: T | (() => T), delayOrOptions: number | UseDebouncedCallbackOptions): [T, Dispatch<SetStateAction<T>>]; |
@@ -6,3 +6,5 @@ import { useState } from 'react'; | ||
* Similar to `useState`, except the setter function is debounced by | ||
* the specified delay. | ||
* the specified delay. Unlike `useState`, the returned setter is not "pure" having | ||
* the side effect of scheduling an update in a timeout, which makes it unsafe to call | ||
* inside of the component render phase. | ||
* | ||
@@ -9,0 +11,0 @@ * ```ts |
{ | ||
"name": "@restart/hooks", | ||
"version": "0.4.14", | ||
"version": "0.4.15", | ||
"main": "cjs/index.js", | ||
@@ -5,0 +5,0 @@ "types": "cjs/index.d.ts", |
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
196498
5468