diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-26 21:33:26 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-26 21:33:26 +0200 |
| commit | be3b2bd56550b71a2ffb7eb1604c1b8c1d2dd4a2 (patch) | |
| tree | f8b77bcfd10187328b3fadc0de3e1eb6dfa08f8d /app/client/socket/socket.task.js | |
| parent | 3d836c372d7eff1e2b507888f1ff652a30187c54 (diff) | |
refactor some task stuff
Diffstat (limited to 'app/client/socket/socket.task.js')
| -rw-r--r-- | app/client/socket/socket.task.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/client/socket/socket.task.js b/app/client/socket/socket.task.js new file mode 100644 index 0000000..936d2bc --- /dev/null +++ b/app/client/socket/socket.task.js @@ -0,0 +1,28 @@ +import { dispatch } from '../store' +import types from '../types' + +import { socket } from './socket.connection' + +socket.on('task_res', (data) => { + console.log('system response', data) + switch (data.type) { + // case 'rpc_connected': + // return dispatch({ type: types.system.rpc_connected, runner: data.runner }) + default: + return console.log('no such task command', data.type) + } +}) + +export function start_task(task) { + socket.emit('task', { + cmd: 'start_task', + task, + }) +} + +export function stop_task(task) { + socket.emit('task', { + cmd: 'stop_task', + task, + }) +} |
