From 64dcb3cc172d19a46dbdedee64f2aeac4328414c Mon Sep 17 00:00:00 2001 From: Patrick Burtchaell Date: Sun, 19 Jul 2015 10:21:10 -0500 Subject: [PATCH] Add monitorState --- src/devTools.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/devTools.js b/src/devTools.js index 07b27ba3..045a35dd 100644 --- a/src/devTools.js +++ b/src/devTools.js @@ -84,7 +84,10 @@ function liftReducer(reducer, initialState) { committedState: initialState, stagedActions: [INIT_ACTION], skippedActions: {}, - currentStateIndex: 0 + currentStateIndex: 0, + monitorState: { + isVisible: true, + } }; /** @@ -96,7 +99,8 @@ function liftReducer(reducer, initialState) { stagedActions, skippedActions, computedStates, - currentStateIndex + currentStateIndex, + monitorState } = liftedState; switch (liftedAction.type) { @@ -135,6 +139,16 @@ function liftReducer(reducer, initialState) { } stagedActions = [...stagedActions, action]; break; + case ActionTypes.HIDE: + monitorState = { + isVisible: false, + }; + break; + case ActionTypes.SHOW: + monitorState = { + isVisible: true, + }; + break; default: break; } @@ -151,7 +165,8 @@ function liftReducer(reducer, initialState) { stagedActions, skippedActions, computedStates, - currentStateIndex + currentStateIndex, + monitorState }; }; }