Observables

& Redux

Why Observables ?

Fonctional Reactive Programing (FRP)

Functional Programing

Favorise la Composition

Lower Granularity

State Less

Immutability

Facilitate the development of highly reative UI (ie: real time)

Facilitate the Orchestration of the Application State in an Elegant way

When you build an application one of the primary issues is managing the states of the app, in OOP you have states in every Objects. That creates a lot of states and a lot of work to orchestrate all those states together.

 

In FRP you write Observable Chains that orchestrate the data flow of the application.

 

You don't create Objects that you have to manage, you write the procedural chains that solves the state management elegantly.

Brett Coffin Nov 2017

Redux

Architecture

Ancestor / Inspiration

CQRS

EVENT SOURCING

  • Event
  • Command
  • Immutability
  • Projection
  • Logbook

Redux

  • Action ({type, payload})
  • Event ({type, payload})
  • Effect (side effects ei: remote calls)
  • Immutability
  • Projection (custom extraction of the store state)
  • Store (Current App State)
  • Uni Directional Data flow

Uni-Directional

Data-Flow

Store

UI / Service

Action

Effect

Event

Reducer

Projection

Typeahead OOP Problems

Bombarding the backend

Out of order responces

Ugly state management code

deck

By bretto

deck

  • 339