Hacker News new | ask | show | jobs
by andrewstuart2 3959 days ago
Whoa, that works on objects/properties? I hadn't seen that before. That's nice.
2 comments

Just keep in mind that object spread operators are a TC39 stage 1 proposal at this point.
Yes, here some simple examples:

    (state, action) => ({...state, loading: true})

    (state, {error}) => ({...state, error, loading: false})

    (state, {result:{data}}) => ({...state, ...data, loading: false})