3 ms·
Whoa, that works on objects/properties? I hadn't seen that before. That's nice.
by andrewstuart2 11y ago
Whoa, that works on objects/properties? I hadn't seen that before. That's nice.
- k__ 11y agoYes, here some simple examples: (state, action) => ({...state, loading: true}) (state, {error}) => ({...state, error, loading: false}) (state, {result:{data}}) => ({...state, ...data, loading: false})
- lowboy 11y agoJust keep in mind that object spread operators are a TC39 stage 1 proposal at this point.