diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-01-13 00:04:35 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-01-13 00:04:35 +0100 |
| commit | bb7efd0af0db8183b5b3f96ac0de1bfd9cd249ae (patch) | |
| tree | 75549888c89cdb0bb1ee8d217f77b95db6e966dc /client/faceAnalysis/faceAnalysis.reducer.js | |
| parent | 4060915f156dec87a449a10c96d166d474f2d628 (diff) | |
face analysis frontend scaffolding
Diffstat (limited to 'client/faceAnalysis/faceAnalysis.reducer.js')
| -rw-r--r-- | client/faceAnalysis/faceAnalysis.reducer.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/client/faceAnalysis/faceAnalysis.reducer.js b/client/faceAnalysis/faceAnalysis.reducer.js new file mode 100644 index 00000000..d8e914ab --- /dev/null +++ b/client/faceAnalysis/faceAnalysis.reducer.js @@ -0,0 +1,32 @@ +import * as types from '../types' + +const initialState = () => ({ + query: {}, + result: {}, + loading: false, +}) + +export default function faceAnalysisReducer(state = initialState(), action) { + switch (action.type) { + case types.faceAnalysis.loading: + return { + ...state, + [action.tag]: { loading: true }, + } + + case types.faceAnalysis.loaded: + return { + ...state, + [action.tag]: action.data, + } + + case types.faceAnalysis.error: + return { + ...state, + [action.tag]: { error: action.err }, + } + + default: + return state + } +} |
