logo

Flux vs Redux

Last Updated: 2021-11-19
  • Flux: created by Facebook and used internally; to manage application states; works well with React.
  • Redux: an open-source library following Flux's pattern but made some important changes.

Store

  • Flux: multiple stores per application; each store is a singleton object.
  • Redux: single store, single source of truth, all the state of the application in one object and its called the state tree, separated into data domains internally.

Actions

i.e. Events

  • Flux: an action is a JavaScript object
  • Redux: JavaScript object by default; using Redux middleware, actions can also be functions and promises.

Dispatcher

  • Flux has a single dispatcher and all actions have to pass through that dispatcher. It’s a singleton object. A Flux application cannot have multiple dispatchers.
  • Redux has no dispatcher entity. Instead, the store has the dispatching process baked in.

Github Repo