Skip to content

Commit

Permalink
Don't skip onStart, onStop and onSend actions from payload
Browse files Browse the repository at this point in the history
  • Loading branch information
zalmoxisus committed May 4, 2016
1 parent cd7a88d commit 9ca2d2b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/devTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,15 @@ function send() {
}
}

function async(fn) {
setTimeout(fn, 0);
}

function monitorReducer(state = {}, action) {
if (action.action) {
if (startOn && !started && startOn.indexOf(action.action.type) !== -1) start();
else if (stopOn && started && stopOn.indexOf(action.action.type) !== -1) stop();
else if (sendOn && !started && sendOn.indexOf(action.action.type) !== -1) send();
if (startOn && !started && startOn.indexOf(action.action.type) !== -1) async(start);
else if (stopOn && started && stopOn.indexOf(action.action.type) !== -1) async(stop);
else if (sendOn && !started && sendOn.indexOf(action.action.type) !== -1) async(send);
}
lastAction = action.type;
return state;
Expand Down

0 comments on commit 9ca2d2b

Please sign in to comment.