Redux Architecture

with Piotr Staniów

Code::Dive 2018

Redux 101 - Agenda

Learn
  • What is an application state?
  • What Redux actually is?
  • How to write code in Redux?
Build
  • Implementation of Redux Store
  • Build simple app with Redux
Share
  • Q&A Session

What Redux actually is?

An architectural concept

What Redux actually is?

  • Lightweight, reliable and scalable application architecture (e.g. Facebook, Instagram)
  • A small set of building blocks used to manage the application state
  • A way of thinking about where to put business logic

What's an application state?

What's an application state?

All the data an application needs at any given moment

  • Servers' responses data
  • User input
  • Sensors' feedback (e.g. temperature, GPS location)
  • Persistent data (e.g. tokens)
  • Displayable information

Three principles of Redux

These are the intents of Redux

  • Single Source of Truth
  • Readonly State
  • State is updated with Pure Functions (i.e. reducers)

Redux implementation

Basic Store Implementation

Store with subscription

Thank you

Further questions?

Twitter: @piotrstaniow

Presentation: https://piotrstaniow.github.io/redux-101