diff --git a/src/devTools.js b/src/devTools.js index 805ea93..6cfa3cd 100644 --- a/src/devTools.js +++ b/src/devTools.js @@ -172,6 +172,19 @@ function login() { relay('START'); } +function stop(keepConnected) { + started = false; + isMonitored = false; + if (!socket) return; + socket.destroyChannel(channel); + if (keepConnected) { + socket.off(channel, handleMessages); + } else { + socket.off(); + socket.disconnect(); + } +} + function start() { if (started || socket && socket.getState() === socket.CONNECTING) return; @@ -187,19 +200,6 @@ function start() { }); } -function stop(keepConnected) { - started = false; - isMonitored = false; - if (!socket) return; - socket.destroyChannel(channel); - if (keepConnected) { - socket.off(channel, handleMessages); - } else { - socket.off(); - socket.disconnect(); - } -} - function checkForReducerErrors(liftedState = store.liftedStore.getState()) { if (liftedState.computedStates[liftedState.currentStateIndex].error) { if (started) relay('STATE', filterStagedActions(liftedState, filters));