Day 2 steps 7-9 updates

This commit is contained in:
Elizabeth Craig
2019-03-01 12:41:44 -08:00
parent 91ebfb8517
commit 8e4b697ba8
5 changed files with 79 additions and 57 deletions

View File

@@ -4,20 +4,20 @@
If you don't already have the app running, start it by running `npm start` from the root of the `frontend-bootcamp` folder. Click the "exercise" link under day 2 step 8 to see results.
> Hint! This section is tricky, so all the solution is inside "demo" as usual. Feel free to copy & paste if you get stuck!!
> Hint! This section is tricky, so the whole solution is inside `demo` as usual. Feel free to copy & paste if you get stuck!!
1. open up `exercise/src/reducers/index.ts`
1. Open up `exercise/src/reducers/index.ts`
2. rewrite the reducer functions `todoReducers`, `filterReducers` with the help of `createReducer()`
2. Rewrite the reducer functions `todoReducers` and `filterReducers` with the help of [`createReducer()`](https://redux-starter-kit.js.org/api/createreducer)
3. rewrite the `reducer()` function with `combineReducer()`
3. Rewrite the `reducer()` function with [`combineReducers()`](https://redux.js.org/recipes/structuring-reducers/using-combinereducers)
4. open up `exercise/src/reducers/pureFunctions.ts`
4. Open up `exercise/src/reducers/pureFunctions.ts`
5. rewrite all the reducers related to the todos by following instructions
5. Rewrite all the reducers related to the todos by following the instructions in the code
# Further reading
## Further reading
- immer: https://github.com/mweststrate/immer - improves ergonomics of working with immutables by introducing the concept of mutating a draft
- [`immer`](https://github.com/mweststrate/immer) - Improves ergonomics of working with immutables by introducing the concept of mutating a draft
- redux-starter-kit: https://github.com/reduxjs/redux-starter-kit - help address common concerns of Redux in boilerplate and complexity
- [`redux-starter-kit`](https://github.com/reduxjs/redux-starter-kit) - Help address common concerns of Redux in boilerplate and complexity