Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101574335
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
Tue, Feb 11, 17:15
Size
477 B
Mime Type
text/x-java
Expires
Thu, Feb 13, 17:15 (2 d)
Engine
blob
Format
Raw Data
Handle
24188050
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