Skip to content

Commit

Permalink
Ignore all actions begining with @@.
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Aug 16, 2015
1 parent 7480ef2 commit 85852fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/combineReducers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/combineReducers.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/combineReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export default (reducer) => {
return (state, action) => {
let tapper;

if (action.type === '@@redux/INIT') {
console.info('Ignoring @@redux/INIT. redux-immutable does not support state inflation. Refer to https://github.com/gajus/canonical-reducer-composition/issues/1.');
if (action.type && action.type.indexOf('@@') === 0) {
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.');

return state;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/combineReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('combineReducers', () => {
expect(spy.calledWith('Unhandled action "UNKNOWN".')).to.equal(true);
});
});
describe('when an instance of reducer is called with {type: @@redux/INIT} action.', () => {
describe('when an instance of reducer is called with an action defining type property with a value beginning with "@@".', () => {
let spy;
beforeEach(() => {
spy = sinon.stub(console, 'info');
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('combineReducers', () => {

reducer(state, action);

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);
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);
});
});
describe('when action handler produces a value thats not an instance of Immutable.Iterable', () => {
Expand Down

0 comments on commit 85852fe

Please sign in to comment.