expression reducer and stubbed out component

This commit is contained in:
Colin Megill
2017-11-26 23:19:49 -08:00
parent 4a412bb05c
commit 1e431c6a0a
3 changed files with 75 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
const Expression = (state = {
data: null,
loading: null,
error: null,
}, action) => {
switch (action.type) {
case "get expression started":
return Object.assign({}, state, {
loading: true,
error: null
});
case "get expression success":
return Object.assign({}, state, {
error: null,
loading: false,
data: action.data.data,
});
case "get expression error":
return Object.assign({}, state, {
data: null,
loading: false,
error: action.data
});
default:
return state;
}
};
export default Expression;