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

Function reducer

examples/files/app/posts.js:19–28  ·  view source on GitHub ↗
(state, action)

Source from the content-addressed store, hash-verified

17}
18
19export function reducer(state, action) {
20 switch (action.type) {
21 case types.LOADING:
22 return { ...state, loading: true, error: false }
23 case types.SUCCESS:
24 return { loading: false, error: false, posts: action.payload }
25 case types.FAILURE:
26 return { ...state, loading: false, error: true }
27 }
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected