diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-26 23:58:46 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-26 23:58:46 +0200 |
| commit | 66dfb9e5ca6b3e2990d9b70314d404074b1be0cb (patch) | |
| tree | 0944916eb1d89f145a4fe67ea11fe2bc6afe116f /app/client/system/system.reducer.js | |
| parent | 1d4fca365ae76f193c05da6eb1d58b41b171e359 (diff) | |
streaming script output to the browser
Diffstat (limited to 'app/client/system/system.reducer.js')
| -rw-r--r-- | app/client/system/system.reducer.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js index ac7b20e..2a58cd7 100644 --- a/app/client/system/system.reducer.js +++ b/app/client/system/system.reducer.js @@ -31,9 +31,11 @@ const systemInitialState = { loaded: false, name: null, error: null, - stdout: null, - stderr: null, + stdout: "", + stderr: "", }, + stdout: "", + stderr: "", } const systemReducer = (state = systemInitialState, action) => { @@ -142,6 +144,16 @@ const systemReducer = (state = systemInitialState, action) => { stderr: action.data.stderr, } } + case types.system.stdout: + return { + ...state, + stdout: state.stdout + action.data, + } + case types.system.stderr: + return { + ...state, + stderr: state.stderr + action.data, + } default: return state } |
