6 ms·
If you support ES6/ES7 in your build cycle then we are big fans of the spread operator which can be used instead of _.default, Object.assign. For example:
by roughcoder 10y ago
If you support ES6/ES7 in your build cycle then we are big fans of the spread operator which can be used instead of _.default, Object.assign. For example:
case 'CHANGE_LOCATION':
return {
...state,
location: action.location
}
- Arnavion 10y agoNote that object spreading is neither an ES6 nor an ES7 feature. It is currently at stage 2 - https://github.com/tc39/proposals#active-proposals https://github.com/tc39/proposals#active-proposals "Rest/Spread Properties"