Months
March 4, 2017
Yuri Takhteyev CTO
1
- f Redux
+ 19 Ranglers
1 8 Months of Redux March 4, 2017 Yuri Takhteyev CTO + 19 - - PowerPoint PPT Presentation
1 8 Months of Redux March 4, 2017 Yuri Takhteyev CTO + 19 Ranglers Redux at Rangle Weve been actively using Redux for a bit over 18 months. This is a good opportunity to re fl ect on what weve De fi ne learned. Prepare
March 4, 2017
Yuri Takhteyev CTO
+ 19 Ranglers
Define Prepare Execute
Redux at Rangle
months.
learned.
Define Prepare Execute Brendan Moore Ken Ono Steve Chae Alex Sapronov Daniel Figueiredo Katie Egervari Mo Binni Nikolas LeBlanc Thomas Marek Varun Vachhar John Chen Rob Brander Michael Bennett Andrew Lo Evan Schultz Seth Davenport Adam Winick Mark Degani Michael Faust
Contributors
Define Prepare
What We’ve Learned: Redux is Great!
projects.
Overview
Define Prepare Execute
What’s So Great?
Overview
Define Prepare Execute
More Great Stuff
your way around it.*
Overview
Define Prepare Execute
Caveats
handling side effects.
Overview
Define Prepare Execute
Understanding the Key Concepts
Groking Redux
const.logger.=.store.=>.next.=>.action.=>.{ ..… };
Define Prepare Execute
More Tips
Groking Redux
Define Prepare Execute
Component Updates
updates.
exacerbate this.
can connect lower in the component tree.
Performance
Define Prepare Execute
Should It Go in the Store?
state? Usually the store.
The Store
Define Prepare Execute
How to Layout the Store?
The Store
Define Prepare Execute
Rules of Thumb for Your Store
appropriate.
The Store
Define Prepare Execute
Enforcing Immutability
a cost.
immutable-helper, seamless-immutable.
The Store
Define Prepare Execute
Use Selectors
selectors, to avoid recalculation.
The Store
Define Prepare Execute
Combine Simple Reducers
Reducers
Define Prepare Execute
Higher Order Reducers
ignoreActions (form redux-ignore).
Reducers
Define Prepare Execute
Example: A Reducer
let.colors.=.(state,.action).=>.{ ..switch.(action.type).{ ....case.COLOR_ADDED: ......return.[...state,.action.payload]; ....case.COLOR_REMOVED': ......return.state.filter(n.=> ..............n.id.!==.action.payload.id); ....default.state; ..} }
Reducers
Define Prepare Execute
Example: A Higher Order Reducer
let.listReducer.=.(addAction,.removeAction).=>. ..(state,.action).=>.{ ....switch.(action.type).{ ......case.addAction: ........return.[...state,.action.payload]; ......case.removeAction': ........return.state.filter( ................n.=>.n.id.!==.action.payload.id); ......default.state; ....} ..} }. let.app.=.combineReducers({ ..colors:.listReducer(COLOR_ADDED,.COLOR_REMOVED), ...... }
Reducers
Define Prepare Execute
Keep Your Actions Simple
Side Effects
Define Prepare Execute
Redux-Thunk
creators.
also.
Side Effects
Define Prepare Execute
Sagas and Observables
two long term solutions.
Side Effects
Define Prepare Execute
Focus on Testing What Matters
Testing
Define Prepare Execute
Testing Action Creators
action creators?
Testing
Define Prepare Execute
Testing Side Effects
Testing
@qaramazov @rangleio
March 4, 2017
Yuri Takhteyev CTO
18 Months of Redux
+ collaborators