Skip to content

Instantly share code, notes, and snippets.

@nross83
Last active February 17, 2017 01:40
Show Gist options
  • Save nross83/5e37ac73e03a37ee1e33a624228d0d66 to your computer and use it in GitHub Desktop.
Save nross83/5e37ac73e03a37ee1e33a624228d0d66 to your computer and use it in GitHub Desktop.
Immutable Data Structures Comparison

Pros

  • Freezes objects in development mode, but not in production. Allows for much better performance
  • Can be used as regular JS objects and arrays. Allows destructuring, rest operators, etc
  • Adds helper functions such as setIn, merge, update, etc
  • Much simpler API than ImmutableJS
  • Allows for converting an Immutable object to mutable for common mutation tasks (push, unshift, etc) and then sealing it back up with a new Immutable constructor call.
  • 2809 stars on GH

Cons

  • Don't support common mutation methods like push, unshift, etc. Instead throws an error. Seamless-immutable claims to be able to do all mutation with concat, without, filter, etc.
  • Doesn't have getIn (yet, although a commit for it was just added. Should be in the next build!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment