The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Updating nested values with ImmutableJS

Updating nested values with ImmutableJS

6:27
The key to being productive with Immutable JS is understanding how to update values that are nested. Using `setIn` you can place a new value directly into an existing or new path. If you need access to the previous value before setting the new one, you can use `updateIn` instead. `updateIn` accepts the same path lookups as `setIn`, but gives you a callback function instead so that you can use the previous value however you wish and return an updated version.
Watch this lesson now
Avatar
egghead.io

The key to being productive with Immutable JS is understanding how to update values that are nested. Using setIn you can place a new value directly into an existing or new path. If you need access to the previous value before setting the new one, you can use updateIn instead. updateIn accepts the same path lookups as setIn, but gives you a callback function instead so that you can use the previous value however you wish and return an updated version.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?