MCPcopy Index your code
hub / github.com/streamich/react-use / set

Function set

src/useIdle.ts:19–24  ·  view source on GitHub ↗
(newState: boolean)

Source from the content-addressed store, hash-verified

17 let timeout: any;
18 let localState: boolean = state;
19 const set = (newState: boolean) => {
20 if (mounted) {
21 localState = newState;
22 setState(newState);
23 }
24 };
25
26 const onEvent = throttle(50, () => {
27 if (localState) {

Callers 15

useIdleFunction · 0.70
downFunction · 0.70
upFunction · 0.70
useSetStateFunction · 0.70
useTimeoutFnFunction · 0.70
useKeyPressFunction · 0.70
useMapFunction · 0.70
onFrameFunction · 0.70
onStartFunction · 0.70
useQueueFunction · 0.70
useMeasureDirtyFunction · 0.70
useAsyncFnFunction · 0.70

Calls 1

setStateFunction · 0.85

Tested by

no test coverage detected