Download - "Reducers in Action" Антон Молдован
![Page 1: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/1.jpg)
Reducers in Action
Anton Moldovan EY
@antyadev
![Page 2: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/2.jpg)
About me:
@AntyaDev like types*
![Page 3: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/3.jpg)
![Page 4: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/4.jpg)
![Page 5: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/5.jpg)
![Page 6: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/6.jpg)
![Page 7: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/7.jpg)
Is an architectural pattern proposed by Greg Young that segregates reads and writes of system into two separate subsystems.
![Page 8: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/8.jpg)
![Page 9: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/9.jpg)
Capture intent Easy to Scale
![Page 10: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/10.jpg)
![Page 11: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/11.jpg)
![Page 12: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/12.jpg)
![Page 13: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/13.jpg)
![Page 14: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/14.jpg)
![Page 15: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/15.jpg)
append only
![Page 16: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/16.jpg)
![Page 17: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/17.jpg)
![Page 18: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/18.jpg)
![Page 19: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/19.jpg)
![Page 20: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/20.jpg)
![Page 21: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/21.jpg)
![Page 22: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/22.jpg)
![Page 23: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/23.jpg)
![Page 24: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/24.jpg)
Reducer<I,E> :: (I, E) -> I
A pure function that takes an initial value and an element, and returns a new value for the initial item
![Page 25: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/25.jpg)
const counter = (state, action) => { switch (action.type) { case 'INCREMENT': return state + 1; case 'DECREMENT': return state – 1; default: return state; } }
(state, action) => state
![Page 26: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/26.jpg)
Mutate its arguments
Perform side effects like API calls
Calling non-pure functions like Date.now() or Math.random()
![Page 27: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/27.jpg)
Th
e P
ro
blem
![Page 28: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/28.jpg)
Greg Young • Event Sourcing https://www.youtube.com/watch?v=8JKjvY4etTY GregYoung 8 CQRS Class https://www.youtube.com/watch?v=whCk1Q87_ZI Timelines at Scale http://www.infoq.com/presentations/Twitter-Timeline-Scalability Redux http://redux.js.org/index.html
![Page 29: "Reducers in Action" Антон Молдован](https://reader034.vdocuments.mx/reader034/viewer/2022042600/58f204f81a28abb10e8b461d/html5/thumbnails/29.jpg)
@antyadev