Slide 1

Slide 1 text

What is Redux? (vs. MVC) Wri$en by Callum Silcock (csi-lk) for MessageMedia

Slide 2

Slide 2 text

Analogies • Ac$ons = Controller • Whenever you want something to happen dispatch an ac$on • Just like when you would call the controller • Reducer = Model (kind of) • Reducers hold the current state of the applica$on • Also decides what to do when you call the ac$on • in MVC you might have a model with the method setName(),

Slide 3

Slide 3 text

Huh? One of the main differences between MVC and Redux is that, while in MVC data can flow in a bidirec

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

The state • Like having a big set of data for the en3re applica3on • Javascript object • Cannot be modified directly (read only and immutable) • Changes are made with actions • Predictable changes • Logged • Obvious

Slide 7

Slide 7 text

Let’s start Live code example within our applica4on • Define ac)on • Define reducer • Add ac)on as prop in component • Wire it up in the view

Slide 8

Slide 8 text

Redux dev tools • Show ac)ons within applica)on

Slide 9

Slide 9 text

Log rocket • Really cool

Slide 10

Slide 10 text

Resources • Thinking in Redux when all you've known is MVC • Ge:ng started with redux • React applica?ons with idoma?c redux