Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99388016
useDebouncedState.d.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 24, 02:44
Size
477 B
Mime Type
text/x-java
Expires
Sun, Jan 26, 02:44 (2 d)
Engine
blob
Format
Raw Data
Handle
23788295
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
useDebouncedState.d.ts
View Options
import { Dispatch, SetStateAction } from 'react';
/**
* Similar to `useState`, except the setter function is debounced by
* the specified delay.
*
* ```ts
* const [value, setValue] = useDebouncedState('test', 500)
*
* setValue('test2')
* ```
*
* @param initialState initial state value
* @param delay The milliseconds delay before a new value is set
*/
export default function useDebouncedState<T>(initialState: T, delay: number): [T, Dispatch<SetStateAction<T>>];
Event Timeline
Log In to Comment