Skip to content

Commit c53ff52

Browse files
committed
Prefer object spread over Object.assign in documentation
1 parent aad4fd5 commit c53ff52

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ function mapStateToProps(state) {
366366
}
367367

368368
function mapDispatchToProps(dispatch) {
369-
return bindActionCreators(Object.assign({}, todoActionCreators, counterActionCreators), dispatch);
369+
return bindActionCreators({ ...todoActionCreators, ...counterActionCreators}, dispatch);
370370
}
371371

372372
export default connect(mapStateToProps, mapDispatchToProps)(TodoApp);
@@ -394,10 +394,11 @@ function mapStateToProps(state) {
394394
}
395395

396396
function mergeProps(stateProps, dispatchProps, ownProps) {
397-
return Object.assign({}, ownProps, {
397+
return {
398+
...ownProps,
398399
todos: stateProps.todos[ownProps.userId],
399400
addTodo: (text) => dispatchProps.addTodo(ownProps.userId, text)
400-
});
401+
};
401402
}
402403

403404
export default connect(mapStateToProps, actionCreators, mergeProps)(TodoApp);

0 commit comments

Comments
 (0)