cells reducer and middleware listen for actions

This commit is contained in:
Colin Megill
2017-10-12 19:33:00 -07:00
parent e7ed697def
commit 48a75beaf9
2 changed files with 60 additions and 38 deletions
+3 -3
View File
@@ -4,17 +4,17 @@ const Cells = (state = {
error: null,
}, action) => {
switch (action.type) {
case "REQUEST_CELLS":
case "request cells started":
return Object.assign({}, state, {
loading: true,
error: null
});
case "RECEIVE_CELLS":
case "request cells success":
return Object.assign({}, state, {
error: null,
cells: action.data,
});
case "CELLS_FETCH_ERROR":
case "request cells error":
return Object.assign({}, state, {
cells: null,
error: action.data