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

Functional Reactive Programming for web apps

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Functional Reactive Programming for web apps

Avatar for Sergio Rafael Gianazza

Sergio Rafael Gianazza

April 23, 2015

More Decks by Sergio Rafael Gianazza

Other Decks in Programming

Transcript

  1. ♥

  2. ♥

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

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

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

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

    actions actions iniLal  state states states update(acLon,  state)
  7. 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)
  8. 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)
  9. 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)
  10. +

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

    map actions actions {  type:  CREATE_POST  }   {  type:  RECEIVE_POST  }
  12. 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)
  13. 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)
  14. 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)
  15. 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