Skip to content

Commit

Permalink
default receiveState should hard set state to the incoming state.
Browse files Browse the repository at this point in the history
  • Loading branch information
rowrowrowrow committed Nov 2, 2021
1 parent 1d3ba93 commit cd18f20
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/syncState.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var defaultConfig = {
prepareState: function prepareState(state) {
return state;
},
receiveState: function receiveState(state) {
return state;
receiveState: function receiveState(prevState, nextState) {
return nextState;
}
};

Expand Down
2 changes: 1 addition & 1 deletion dist/syncState.umd.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/syncState.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/syncState.umd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/syncState.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const defaultConfig = {
whitelist: [],
broadcastChannelOption: undefined,
prepareState: state => state,
receiveState: state => state,
receiveState: (prevState, nextState) => nextState,
};

const getIniteState = () => ({ type: GET_INIT_STATE });
Expand Down

0 comments on commit cd18f20

Please sign in to comment.