(state, action)
| 17 | } |
| 18 | |
| 19 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected