Re:Pros and Cons of using immutability with React.js
by andrewstuart2 on Friday August 14, 2015 @11:59AM
(#10060839)
Whoa, that works on objects/properties? I hadn't seen that before. That's nice.
[ Parent
| on HN ]
Re:Pros and Cons of using immutability with React.js
by lowboy on Friday August 14, 2015 @12:24PM
(#10061013)
Just keep in mind that object spread operators are a TC39 stage 1 proposal at this point.
Re:Pros and Cons of using immutability with React.js
by k__ on Friday August 14, 2015 @12:03PM
(#10060878)
Yes, here some simple examples:
(state, action) => ({...state, loading: true})
(state, {error}) => ({...state, error, loading: false})
(state, {result:{data}}) => ({...state, ...data, loading: false})