Skip to content

Commit

Permalink
fix Object.assign should be given empty object as first argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Jul 19, 2015
1 parent eef5084 commit 8aa3773
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/createContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export function createContainer(options = {}, Component) {
if (cat.fetchMap) {
debug('%s getPayload in componentWillMount', getName(this));
const payload = getPayload(
assign(this.state, this.props),
assign({}, this.state, this.props),
getChildContext(Component.contextTypes, this.context)
);

Expand Down Expand Up @@ -252,7 +252,7 @@ export function createContainer(options = {}, Component) {
debug('%s fetching on componentDidMount', getName(this));
options.action(
getPayload(
assign(this.state, this.props),
assign({}, this.state, this.props),
getChildContext(Component.contextTypes, this.context)
)
);
Expand All @@ -265,16 +265,16 @@ export function createContainer(options = {}, Component) {
options.action &&
options.shouldContainerFetch &&
options.shouldContainerFetch(
assign(this.state, this.props),
assign(this.state, nextProps),
assign({}, this.state, this.props),
assign({}, this.state, nextProps),
this.context,
nextContext
)
) {
debug('%s fetching on componentWillReceiveProps', getName(this));
options.action(
getPayload(
assign(this.state, nextProps),
assign({}, this.state, nextProps),
getChildContext(Component.contextTypes, nextContext)
));
}
Expand Down

0 comments on commit 8aa3773

Please sign in to comment.