diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-29 17:10:04 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-29 17:10:04 +0200 |
| commit | d5b95568926623245257c618238485bd41bf66cd (patch) | |
| tree | 7f3bcb1ffc5e3015890c368aa35fd2d76ade98be /app/client | |
| parent | 3791925f07a2e21c3c99c18222b9773ff174344d (diff) | |
reducer for socket events
Diffstat (limited to 'app/client')
| -rw-r--r-- | app/client/modules/samplernn/samplernn.reducer.js | 17 | ||||
| -rw-r--r-- | app/client/socket/index.js | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/app/client/modules/samplernn/samplernn.reducer.js b/app/client/modules/samplernn/samplernn.reducer.js index e486e3f..e70be5b 100644 --- a/app/client/modules/samplernn/samplernn.reducer.js +++ b/app/client/modules/samplernn/samplernn.reducer.js @@ -47,18 +47,27 @@ const samplernnReducer = (state = samplernnInitialState, action) => { } return case types.folder.upload_error: - console.log(action) + console.log(action) return state case types.folder.upload_progress: - console.log(action) + console.log(action) return state case types.folder.upload_complete: - console.log(action) + console.log(action) return state - + case types.socket.status: + return samplernnSocket(state, action) default: return state } } +const samplernnSocket = (state, action) => { + console.log(action) + switch (action.key) { + default: + return state + } +} + export default samplernnReducer diff --git a/app/client/socket/index.js b/app/client/socket/index.js index 1430ac9..87540f4 100644 --- a/app/client/socket/index.js +++ b/app/client/socket/index.js @@ -15,7 +15,7 @@ export default { socket.on('status', (data) => { console.log('got status', data.key, data.value) - store.dispatch({ type: types.socket.status }) + store.dispatch({ type: types.socket.status, ...data }) switch (data.key) { case 'processing': store.dispatch({ |
