Member-only story

React Facades + RxJS

Thomas Burleson
8 min readJan 14, 2020

--

State Management

Applications often (a) need to share or reuse data and (b) have many events to change data. State management allows us to centralize data changes and control the insanity.

Developers often approach state management with reluctance, fear, and a naive understanding of when and how to use it.

I decided to write this tutorial to demonstrate real-world, best-practices when using state management in React.

State management is important when data:

  1. Must be shared between components,
  2. Must be accessible independent of view instances, and
  3. Changes to the data should be centralized
  4. Changes notifications should performantly update views

Redux Pattern

The Redux pattern is widely recognized as an important choice to manage state changes. Unfortunately, implementations of the Redux pattern (eg ReduxJS) often leads to lots of cruft (large numbers of files).

Let’s use a better solution (and avoid the cruft)!

Akita for State Management.

Akita is a relatively quiet newcomer — which uses the Flux/Redux patterns — that is making a huge splash in the RxJS + State Management waters. Akita enables us to easily build reactive, asynchronous, data-push solutions for our state management needs.

With data-push architectures, view components simply react to asynchronous data change notifications and render the current data values.

Akita is a state management pattern, built on top of RxJS, which combines the idea of multiple data stores from Flux, the immutable updates from Redux, and the power of streaming data to create the Observable Data Stores model.

more about Akita…

Push-based Architectures:

Here are some more articles for those developers interested in learning more about RxJS and push-based architectures:

--

--

Thomas Burleson
Thomas Burleson

Written by Thomas Burleson

Solutions architect expert in NextJS, React and Angular solutions. Formerly a Principal Architect @ Nrwl.io, Team Lead for Angular, Google.

Responses (4)

Write a response