Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Created May 15, 2017 10:42
Show Gist options
  • Save OliverJAsh/bda7dc6dcc00ae3d4d51ed602ff52c80 to your computer and use it in GitHub Desktop.
Save OliverJAsh/bda7dc6dcc00ae3d4d51ed602ff52c80 to your computer and use it in GitHub Desktop.
What are some pros/cons to using iterables (sagas) and observables in Redux?

What are some pros/cons to using iterables (sagas) and observables in Redux?

Iterables (Sagas)

Pros

  • Most popular solution, so probably better community support.
  • Testing: very easy to mock side effects using "call" effect.

Cons

  • Lack of operators (retry, take, etc.).

Observables

Pros

  • Good tooling for visualising control flow, e.g. http://rxfiddle.net/.
  • Transferable skills to other languages (Rx).
  • Transferable skills to other domains (all async stuff, not just Redux).
  • Large collection of battle tested operators (retry, take, etc.).

Cons

  • Testing: harder to mock side effects.

More thoughts: http://stackoverflow.com/questions/40021344/why-use-redux-observable-over-redux-saga

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