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

Function addAndReset

tests/createReducer.test.ts:36–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35 // Action creator to increment count, wait a second and then reset
36 const addAndReset = () => {
37 return (dispatch) => {
38 dispatch({ type: 'increment' });
39
40 setTimeout(() => {
41 dispatch({ type: 'reset', payload: initialCount });
42 }, 1000);
43 };
44 };
45
46 const setUp = () => {
47 const useThunkReducer = createReducer(thunk, logger);

Callers 2

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…