Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Data Flow in react / react-native

Avatar for Chetan Chetan
November 02, 2015

Data Flow in react / react-native

I gave talk about data flow in react and react native in mumbai javascript-ruby meetup on 31st October 2015

Avatar for Chetan

Chetan

November 02, 2015
Tweet

Other Decks in Programming

Transcript

  1. Stores !== Model not a observable object (View subscribe to

    store) only access data using getter method (ex. no model.balance but store.getBalance()) Can not edit data directly like Model so model.balance = 10 not possible
  2. Stores View Action Dispatcher action ={ type: ‘ADD_TASK’, text: ‘Do

    yoga’ } ToDos =[ { id:1, text: ‘Do yoga’, iscomplete : false } ]
  3. Stores View Action Dispatcher action ={ type: ‘COMEPLTE_TA SK’, id:1

    } ToDos =[ { id:1, text: ‘Do yoga’, iscomplete : true } ]
  4. ToDo View Action Dispatcher Profile View User : { total

    : 1, remaining: 1 } Todos :[ { id : 1, text : ‘Do yoga’, iscompleted : 0 } ]
  5. ToDo View Action Dispatcher Profile View User : { total

    : 1, remaining: 0 } Todos :[ { id : 1, text : ‘Do yoga’, iscompleted : 1 } ] Action : { type : ‘COMPLETE_TASK’, id: 1 }
  6. What is Redux ? Implementation of flux (!?) Single Store

    (Single source of truth) Immutable not have the concept of a Dispatcher