Skip to content

Instantly share code, notes, and snippets.

@hew
Last active January 12, 2019 19:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hew/931c45ff5d9d3e9b4901d04de72a28ef to your computer and use it in GitHub Desktop.
Save hew/931c45ff5d9d3e9b4901d04de72a28ef to your computer and use it in GitHub Desktop.
Redux vs. MobX

Redux vs. MobX notes

Mobx

Abstract: Observables are a powerful new data type

Demo: Click Here

Pros

  • Write less code; do more.
  • MobX is FAST. (Author explanation), (benchmarks)
  • The speed kind of just works out of the box.
  • Small API that is easy to learn
  • Can actually replace React's state system as MobX is faster a lot of the time.

Cons

  • Developer cost of learning a new technology
  • Observables/decorators, today, are transpiled ES7
  • Decorators are kind of automagical in that a lot of the complexity is hidden from the developer.

 

Redux

Abstract: Stateless functions. That's it.

demo: Click Here

Pros

  • Just plain Javascript
  • Crazy successful adoption and the backing of (and subsequent author hire by) Facebook means huge developer ecosystem with lots of plugins/forks/etc
  • Easy to test

Cons

  • Lots of boilerplate code just to get going
  • Verbose code just overall - and in many different places
  • While easier to test, hard(er) to reason about (imo)
  • CAN be more-or-less just as fast as MobX, but getting to that speed takes some doin and moderate knowledge. (link)

 

Helpful Links:

  1. The Introduction to FRP You've Been Missing

  2. Introduction to Mobx

  3. Why Formidable Labs Chose Mobx

  4. Learning React Redux

  5. MobX Examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment