MCPcopy Create free account
hub / github.com/streamich/react-use / useUpdate

Function useUpdate

src/useUpdate.ts:5–9  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3const updateReducer = (num: number): number => (num + 1) % 1_000_000;
4
5export default function useUpdate(): () => void {
6 const [, update] = useReducer(updateReducer, 0);
7
8 return update;
9}

Callers 10

DemoFunction · 0.90
DemoFunction · 0.90
useGetSetStateFunction · 0.85
useStateListFunction · 0.85
useListFunction · 0.85
useGetSetFunction · 0.85
useTimeoutFunction · 0.85
useUpdate.test.tsFile · 0.85
DemoFunction · 0.85
DemoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…