MCPcopy Create free account
hub / github.com/dabbott/react-native-express / reducer

Function reducer

examples/files/app/todos.js:24–34  ·  view source on GitHub ↗
(state, action)

Source from the content-addressed store, hash-verified

22}
23
24export function reducer(state, action) {
25 switch (action.type) {
26 case types.ADD:
27 return { ...state, items: [...state.items, action.payload] }
28 case types.REMOVE:
29 return {
30 ...state,
31 items: state.items.filter((item) => item.id !== action.payload),
32 }
33 }
34}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected