diff options
Diffstat (limited to 'web/src/js/ducks/flows.js')
-rw-r--r-- | web/src/js/ducks/flows.js | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index aad82de2..4b4b2a88 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -123,30 +123,6 @@ export function selectFlow(id) { } /** - * @public websocket - */ -export function handleWsMsg(msg) { - if (msg.cmd === WS_CMD_RESET) { - return fetchData() - } - return { type: WS_MSG, msg } -} - -/** - * @public websocket - */ -export function fetchData() { - return dispatch => { - dispatch(request()) - - return fetch('/flows') - .then(res => res.json()) - .then(json => dispatch(receive(json.data))) - .catch(error => dispatch(fetchError(error))) - } -} - -/** * @public */ export function accept(flow) { @@ -229,6 +205,32 @@ export function upload(file) { } /** + * This action creater takes all WebSocket events + * + * @public websocket + */ +export function handleWsMsg(msg) { + if (msg.cmd === WS_CMD_RESET) { + return fetchData() + } + return { type: WS_MSG, msg } +} + +/** + * @public websocket + */ +export function fetchData() { + return dispatch => { + dispatch(request()) + + return fetch('/flows') + .then(res => res.json()) + .then(json => dispatch(receive(json.data))) + .catch(error => dispatch(fetchError(error))) + } +} + +/** * @private */ export function request() { |