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

Functional Reactive Programming for web apps

Functional Reactive Programming for web apps

Sergio Rafael Gianazza

April 23, 2015
Tweet

More Decks by Sergio Rafael Gianazza

Other Decks in Programming

Transcript

  1. var a = 1; var b = 2; var c

    = a + b; b = 3; console.log(c); // Imperativo = 3, reactivo = 5
  2. intent intent click keydow n input API  rcv Lmeout reduce

    update(acLon,  state) actions actions
  3. intent intent click keydow n input API  rcv Lmeout reduce

    actions actions iniLal  state update(acLon,  state)
  4. intent intent click keydow n input API  rcv Lmeout reduce

    actions actions iniLal  state states states update(acLon,  state)
  5. intent intent click keydow n input API  rcv Lmeout reduce

    map view(state,  inputs) actions actions states states iniLal  state view elements view elements update(acLon,  state)
  6. intent intent click keydow n input API  rcv Lmeout reduce

    map view(state,  inputs) render actions actions states view elements states view elements DOM DOM iniLal  state update(acLon,  state)
  7. intent intent click keydow n input API  rcv Lmeout reduce

    map view(state,  inputs) render actions actions states view elements states view elements DOM DOM iniLal  state update(acLon,  state)
  8. +

  9. ejemplo ejemplo intent.createBlogPost input   subm it API  receive reduce

    map actions actions {  type:  CREATE_POST  }   {  type:  RECEIVE_POST  }
  10. ejemplo ejemplo intent.createBlogPost input   subm it API  receive reduce

    map actions actions states states {  posts:  []  } {  type:  CREATE_POST  }   {  type:  RECEIVE_POST  } {  posts:  [  {  name:  “New  post”}  ]} update(acLon,  state)
  11. ejemplo ejemplo intent.createBlogPost input   subm it API  receive reduce

    map view(state,  inputs) actions actions states view elements states view elements {  posts:  []  } {  type:  CREATE_POST  }   {  type:  RECEIVE_POST  } <Posts  posts={posts}  /> {  posts:  [  {  name:  “New  post”}  ]} update(acLon,  state)
  12. ejemplo ejemplo intent.createBlogPost input   subm it API  receive reduce

    map view(state,  inputs) render actions actions states view elements states view elements DOM DOM {  posts:  []  } {  type:  CREATE_POST  }   {  type:  RECEIVE_POST  } <Posts  posts={posts}  /> {  posts:  [  {  name:  “New  post”}  ]} update(acLon,  state)
  13. MVI MVI intent intent click keydow n input API  rcv

    Lmeout reduce map update view(state,  inputs) render actions actions states view elements states view elements DOM DOM iniLal  state