Skip to content

Commit 0d9c5ea

Browse files
committed
Nuke batching actions
Fix #208.
1 parent d7a199c commit 0d9c5ea

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

src/app/service/Monitor.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ export default class Monitor {
2323
this.active = false;
2424
clearTimeout(this.waitingTimeout);
2525
};
26-
isWaiting = () => {
27-
const currentTime = Date.now();
28-
if (this.lastTime && currentTime - this.lastTime < 200) {
29-
// no more frequently than once in 200ms
30-
this.stop();
31-
this.waitingTimeout = setTimeout(this.start, 1000);
32-
return true;
33-
}
34-
this.lastTime = currentTime;
35-
return false;
36-
};
3726
isHotReloaded = () => this.lastAction === '@@redux/INIT';
3827
isMonitorAction = () => monitorActions.indexOf(this.lastAction) !== -1;
3928
isTimeTraveling = () => this.lastAction === 'JUMP_TO_STATE';

src/browser/extension/inject/pageScript.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ window.devToolsExtension = function(reducer, preloadedState, config) {
133133
if (action.type === '@@INIT') {
134134
relay('INIT', state, { timestamp: Date.now() });
135135
} else if (!errorOccurred && !monitor.isMonitorAction()) {
136-
if (
137-
monitor.isTimeTraveling() || isFiltered(action, localFilter) || monitor.isWaiting()
138-
) return;
136+
if (monitor.isTimeTraveling() || isFiltered(action, localFilter)) return;
139137
const { maxAge } = window.devToolsOptions;
140138
relay('ACTION', state, liftedAction, nextActionId);
141139
if (!isExcess && maxAge) isExcess = liftedState.stagedActionIds.length >= maxAge;

test/app/inject/enhancer.spec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ describe('Redux enhancer', () => {
4848
window.store.dispatch({ type: 'INCREMENT' });
4949
expect(window.store.getState()).toBe(2);
5050
});
51-
expect(message.type).toBe('STATE');
52-
const count = message.payload.computedStates.length - 1;
53-
expect(message.payload.actionsById[count].action.type).toBe('INCREMENT');
54-
expect(message.payload.computedStates[count].state).toBe(2);
51+
expect(message.type).toBe('ACTION');
52+
expect(message.action.action.type).toBe('INCREMENT');
53+
expect(message.payload).toBe(2);
5554
});
5655

5756
it('should dispatch actions remotely', async () => {

0 commit comments

Comments
 (0)