reading-notes

Notes for Codefellows Code 401 301 201 and 102

Readings Class 38: Redux - Asynchronous Actions

How granular should your reducers be?

source When a change of any of those attributes would trigger a separate kind of action such as CHANGE_EMAIL or CHANGE_NAME. And sometimes such granularity is good and sometimes it might be much easier for reducers if they can distinguish between those two particular use-cases.

Pro or Con – multiple reducers can “fire” when a commonly named action is dispatched

source This is a nono, you should avoid dispatching several times synchronously in a row in the places where you’re concerned about performance. There are a number of addons and approaches that can batch up dispatches as well.

Name a strategy for preventing the above

source If you actually are concerned about reducer performance, you can use a utility such as redux-ignore or reduxr-scoped-reducer to ensure that only certain reducers listen to specific actions. You can also use redux-log-slow-reducers to do some performance benchmarking.

Document the following Vocabulary Terms

store

a single object tree that contains the state of the app.

combined reducers

helper function turns an object whose values are different reducing functions into a single reducing function you can pass to createStore.

Preview

Preparation Materials