Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100872251
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
Mon, Feb 3, 11:57
Size
477 B
Mime Type
text/x-java
Expires
Wed, Feb 5, 11:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24046198
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