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

redux
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Redux

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

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

What is Redux

slide-4
SLIDE 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?

slide-5
SLIDE 5

What is Redux?

Why do we need to use it?

slide-6
SLIDE 6

What is Redux?

Time-traveling debugger

slide-7
SLIDE 7

Stakeholders

slide-8
SLIDE 8

Stakeholders

Dan Abramov Andrew Clark 

Co-authors

slide-9
SLIDE 9

Stakeholders

Open-source community

Developers

Facebook

slide-10
SLIDE 10

Stakeholders Contributors

slide-11
SLIDE 11

Stakeholders How to contribute

Stable software

Issues

Pull request to "next" branch

slide-12
SLIDE 12

Components

slide-13
SLIDE 13

Components

Actions

Reducers

Store

slide-14
SLIDE 14

Actions

Action: (p1, p2, ...) => {type , p1, p2, ...}

  • Says "something will be done“
  • Stores the parameters
slide-15
SLIDE 15

Reducers

Reducer: ( previousState, action ) => newState Action: (p1, p2, ...) => {type , p1, p2, ...}

  • 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
slide-16
SLIDE 16

Store

Reducer: ( previousState, action ) => newState Action: (p1, p2, ...) => {type , p1, p2, ...} Store:

  • subscribe: () => unsubscribe()
  • dispatch: (action) => ()
  • getState: () => currentState
  • Initiates the execution of an action
  • Maintains the current state
  • Notifies changes to the components
slide-17
SLIDE 17

Architectural style

slide-18
SLIDE 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!!!

slide-19
SLIDE 19

Unidirectional Data Flow

Predictable

Easier to debug

Easier to modify

Less error prone

slide-20
SLIDE 20

Quality Attributes

slide-21
SLIDE 21

Quality Attributes

Lets see what they tell us on their official website:

slide-22
SLIDE 22

Quality Attributes

From this we can conclude that the quality attributes they value the most are:

Reliability Reusability Supportability Interoperability

slide-23
SLIDE 23

Constraints

slide-24
SLIDE 24

Constraints

Open Source Three main principles: Single source

  • f truth

State is read-

  • nly

Changes are made with pure functions Make state mutations predictable

slide-25
SLIDE 25

Development Aspects

slide-26
SLIDE 26

Development Aspects

Written purely on TypeScript and Javascript Modular

slide-27
SLIDE 27

Any Questions?