import socket from '../socket' import types from '../types' export const run = (cmd) => (dispatch) => { dispatch({ type: types.system.running_command, cmd }) socket.system.run_system_command(cmd) .then(data => { dispatch({ type: types.system.command_output, data: data, }) }) } export const listDirectory = (opt) => (dispatch) => { dispatch({ type: types.system.listing_directory, opt }) socket.system.list_directory(opt) .then(data => { dispatch({ type: types.system.list_directory, data: data, }) }) } export const changeTool = (tool) => { return { type: types.app.change_tool, tool } }