MCPcopy Create free account
hub / github.com/WebReflection/neverland / reducer

Function reducer

test/test.js:38–47  ·  view source on GitHub ↗
(state, action)

Source from the content-addressed store, hash-verified

36 const initialState = {count: 0};
37
38 function reducer(state, action) {
39 switch (action.type) {
40 case 'reset':
41 return initialState;
42 case 'increment':
43 return {count: state.count + 1};
44 case 'decrement':
45 return {count: state.count - 1};
46 }
47 }
48
49 const staticInfo = [
50 {type: 'increment', text: '+'},

Callers 2

useReducerFunction · 0.85
useReducerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected