//Redux’s First Principles

Redux’s First Principles

Principle 1 – Redux has a single source of truth – and object that contains all of your applications state.

This single source of truth is a state tree that is simply an object containing functions (methods) and other data.

Principle 2 – Redux state is read-only and cannot be mutated.

The only way to mutate the state is to emit an action. An action is an object describing what happened.

Principle 3 – Redux mutations are written as pure functions

A reducer is a pure function you write to implement the update logic of your app, that is how the next state is calculated given the current state and the action being dispatched.

By |2018-08-31T19:44:00+00:00August 31st, 2018|Uncategorised|0 Comments

About the Author:

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.