swapped it back to react-redux

This commit is contained in:
Ken
2019-03-03 09:31:59 -08:00
parent 3eb97ab85a
commit 27bf77b34f
8 changed files with 131 additions and 60 deletions

View File

@@ -5,12 +5,15 @@
In this step, we will look at solving the problems of complex application (as mentioned in Step 4) with a library called Redux.
1. Introduction to Redux
2. Creating the Redux store
3. Writing reducers
4. Dispatching actions
2. Why Use Redux?
3. Creating the Redux store
4. Writing reducers
5. Dispatching actions
---
## Introduction to Redux
As a reminder, the problem that we want to address are:
1. Data needs to be passed down from component to component via props. Even when some components do not need to know about some data.
@@ -38,6 +41,15 @@ The [store](https://redux.js.org/basics/store) consists of a **state tree**, a *
3. **Reducers** are functions that take in the current state tree and an action, producing the next snapshot of the state tree.
## Why Use Redux?
There are lots of alternatives available, but here are some really good reasons to go with Redux:
1. For more complex applications, Flux pattern forces code to be written in a way that is easy to reason about
2. There maybe a need to serialize the application state to be transmitted across the wire somehow
3. Dev tooling is really amazing
4. Popularity of the framework means the ecosystem is mature at this point
# Creating the Redux store
The [`createStore()`](https://redux.js.org/api/createstore) function is provided by Redux and can take in several arguments. The simplest form just takes in reducers.