From 8d06839056967e8786c63976545aff098ae2f128 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Jun 2018 01:28:41 +0200 Subject: morph module.. enum method for sliders --- app/client/modules/morph/morph.reducer.js | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 app/client/modules/morph/morph.reducer.js (limited to 'app/client/modules/morph/morph.reducer.js') diff --git a/app/client/modules/morph/morph.reducer.js b/app/client/modules/morph/morph.reducer.js new file mode 100644 index 0000000..92cbc9e --- /dev/null +++ b/app/client/modules/morph/morph.reducer.js @@ -0,0 +1,35 @@ +import types from '../../types' +import datasetReducer from '../../dataset/dataset.reducer' + +const morphInitialState = { + loading: true, + progress: { i: 0, n: 0 }, + error: null, + folder_id: 0, + data: null, + app: null, +} + +const morphReducer = (state = morphInitialState, action) => { + if (action.data && action.data.module === 'morph') { + state = datasetReducer(state, action) + } + + switch (action.type) { + case types.morph.load_results: + return { + ...state, + results: action.results, + } + case types.morph.load: + console.log('morph load', action.app) + return { + ...state, + app: action.app, + } + default: + return state + } +} + +export default morphReducer -- cgit v1.2.3-70-g09d2