Created
December 8, 2017 11:58
-
-
Save vzaidman/ce3272d87767e07d77f8dca0d4422e80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fetchOrders } from './actions' | |
export const vanilaReducerWithToolbeltAction = (state = {}, action) => { | |
switch(action.type): | |
case fetchOrders.TYPE: | |
return { loading: true } | |
case fetchOrders.success.TYPE: | |
return { loading: false, data: action.payload } | |
case fetchOrders.failure.TYPE: | |
return { loading: false, error: action.payload } | |
default: | |
return state | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment