@MoOx
Redux
is a predictable state container
for JavaScript apps.
2
Slide 3
Slide 3 text
@MoOx
3
State
UI
Actions
Reducer
transformed into
dispatches
passed to
returns new
Slide 4
Slide 4 text
@MoOx
- behave consistently
- run in different environments
(client, server, and native)
- are easy to test
4
Redux helps you write
applications that
Slide 5
Slide 5 text
@MoOx
- live code editing (hot reloading)
- time traveling debugger.
5
Redux provides a
great developer experience
Slide 6
Slide 6 text
@MoOx
- persist state (local storage) & boot from it
(CSR & SSR)
- serialize actions & save/reuse those
- easy undo/redo / time traveling
- share business logic between apps
6
Redux allows you to
Slide 7
Slide 7 text
@MoOx
(Not tied to React)
7
Slide 8
Slide 8 text
@MoOx
8 @MoOx
Redux is nice,
makes app structuring foreseeable,
forces developers to think about their model
@MoOx
https://gist.github.com/gaearon/64e2c4adce2b4918c96c3db2b44d8f68
Redux without redux
40
Slide 41
Slide 41 text
@MoOx
“Should you do this to your stateful
components? Probably not.
Not unless you have a plan to benefit
from this additional indirection”
41 https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367
Slide 42
Slide 42 text
@MoOx
What redux does,
ReasonReact and Elm do
42
Actions are types, reducers are functions,
state is immutable, but at the language level
Slide 43
Slide 43 text
@MoOx
43
Slide 44
Slide 44 text
@MoOx
“done in collaboration with the ReactJS team”
44 https://reasonml.github.io/reason-react/blog/2017/09/01/reducers.html
Slide 45
Slide 45 text
@MoOx
- Does my app need this?
- Does my team need this?
- Does my product need this?
@MoOx
45
Before adding Redux
(and other fancy things)
Slide 46
Slide 46 text
@MoOx
Do my users need this?
46
Slide 47
Slide 47 text
@MoOx
Redux is nice
But not required
47
Slide 48
Slide 48 text
@MoOx
Use Redux
when it’s necessary
not before
48
Like any other tool
Slide 49
Slide 49 text
@MoOx
Let’s love Redux
Let’s hate Redux
49
Slide 50
Slide 50 text
@MoOx
(More “you might not need”?)
50
https://youmightnotneed.com
Slide 51
Slide 51 text
@MoOx
51
Questions ?
https://moox.io/
@MoOx
Maxime Thirouin