redux
play

Redux Clara Miranda Garca (UO264958) Daniel Rckert Garca (UO236405) - PowerPoint PPT Presentation

Redux Clara Miranda Garca (UO264958) Daniel Rckert Garca (UO236405) scar Snchez Campo (UO265078) 1. Introduction 2. Stakeholders 3. Components 4. Architectural style 5. Quality Attributes 6. Constraints 7. Development Aspects What is


  1. Redux Clara Miranda García (UO264958) Daniel Rückert García (UO236405) Óscar Sánchez Campo (UO265078)

  2. 1. Introduction 2. Stakeholders 3. Components 4. Architectural style 5. Quality Attributes 6. Constraints 7. Development Aspects

  3. What is Redux

  4. What is Redux? "Redux is a predictable state container for JavaScript applications"   Why do we need a predictable state container?  What is a state container?  How does that fit into modern web applications?

  5. What is Redux? Why do we need to use  it?

  6. What is Redux? Time-traveling debugger 

  7. Stakeholders

  8. Stakeholders Co-authors  Dan Abramov Andrew Clark

  9. Stakeholders Open-source community  Developers  Facebook 

  10. Stakeholders Contributors

  11. Stable software  Stakeholders How to Issues  contribute Pull request to "next" branch 

  12. Components

  13. Components Actions  Reducers  Store 

  14. Action: (p1, p2, ...) => {type , p1, p2, ...} Actions Says "something will be done“ • • Stores the parameters

  15. Action: (p1, p2, ...) => {type , p1, p2, ...} Reducers Reducer: ( previousState, action ) => newState Selects which code will be executed • • Gets the previous state • Returns a new modified state Extracting common code • Reducer composition • Get rid of the switch •

  16. Action: (p1, p2, ...) => {type , p1, p2, ...} Store Reducer: ( previousState, action ) => newState Store: - subscribe: () => unsubscribe() Initiates the execution of an action • - dispatch: (action) => () • Maintains the current state - getState: () => currentState • Notifies changes to the components

  17. Architectural style

  18. Architectural Style The Redux Pattern Based on Flux  3 Principles   Single source of truth  Store  Read-only state  Manipulated by actions, never directly!!!  Changes made with pure functions  Never change the input!!!

  19. Unidirectional Data Flow Predictable  Easier to debug  Easier to modify  Less error prone 

  20. Quality Attributes

  21. Quality Attributes Lets see what they tell us on their official website: 

  22. Quality Attributes From this we can conclude that the quality attributes they value the most are: Reliability Reusability Supportability Interoperability

  23. Constraints

  24. Constraints Single source Open Source of truth Three main State is read- principles: only Make state Changes are mutations made with predictable pure functions

  25. Development Aspects

  26. Development Aspects Written purely on TypeScript Modular and Javascript

  27. Any Questions?

Recommend


More recommend