Skip to content

Commit 85852fe

Browse files
committed
Ignore all actions begining with @@.
1 parent 7480ef2 commit 85852fe

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

dist/combineReducers.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/combineReducers.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/combineReducers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export default (reducer) => {
7676
return (state, action) => {
7777
let tapper;
7878

79-
if (action.type === '@@redux/INIT') {
80-
console.info('Ignoring @@redux/INIT. redux-immutable does not support state inflation. Refer to https://github.com/gajus/canonical-reducer-composition/issues/1.');
79+
if (action.type && action.type.indexOf('@@') === 0) {
80+
console.info('Ignoring private action "' + action.type + '". redux-immutable does not support state inflation. Refer to https://github.com/gajus/canonical-reducer-composition/issues/1.');
8181

8282
return state;
8383
}

tests/combineReducers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('combineReducers', () => {
4141
expect(spy.calledWith('Unhandled action "UNKNOWN".')).to.equal(true);
4242
});
4343
});
44-
describe('when an instance of reducer is called with {type: @@redux/INIT} action.', () => {
44+
describe('when an instance of reducer is called with an action defining type property with a value beginning with "@@".', () => {
4545
let spy;
4646
beforeEach(() => {
4747
spy = sinon.stub(console, 'info');
@@ -70,7 +70,7 @@ describe('combineReducers', () => {
7070

7171
reducer(state, action);
7272

73-
expect(spy.calledWithExactly('Ignoring @@redux/INIT. redux-immutable does not support state inflation. Refer to https://github.com/gajus/canonical-reducer-composition/issues/1.')).to.equal(true);
73+
expect(spy.calledWithExactly('Ignoring private action "@@redux/INIT". redux-immutable does not support state inflation. Refer to https://github.com/gajus/canonical-reducer-composition/issues/1.')).to.equal(true);
7474
});
7575
});
7676
describe('when action handler produces a value thats not an instance of Immutable.Iterable', () => {

0 commit comments

Comments
 (0)