Overview

== Open source JavaScript library
– 2015 released
– state container in a JavaScript web application
– use together with React, and Angular
– all status information is stored centrally and is therefore accessible for all components of the web application

Patterns

– Command Query Responsibility Segregation (CQRS)
→ Separation of the change at the state, purely via commands

– Event Sourcing
→ give sequences of commands to my state and can replay them at any time due to the base state

Core Components

redux

Store

– contains all status information (data object)
→ not changeable, only readable

Action

– plain objects
– are called by the web components and evaluated by reducers
– Instead of mutating the state directly → specify the mutations with Actions

Reducer

– Special function
– Change the global state of the web application
– Adds a new status object to the global state based on the type of an action
– In large apps, you can split the root reducer into smaller reducers independently operating on the different parts of the state tree