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

Functional Reactive Programming

Functional Reactive Programming

Slides for a talk by Wilkes Joiner at Nashville Code Co-op Talk Day.

Jason Orendorff

March 30, 2013
Tweet

More Decks by Jason Orendorff

Other Decks in Programming

Transcript

  1. Streams of Events • Fire and forget events are relatively

    easy to create. • UIs • Ajax posts
  2. Streams of Events • Fire and forget events are relatively

    easy to create. • UIs • Ajax posts • Messaging queues
  3. FRP • A model for values that vary over time

    • Originates from Haskell Community • Several different implementation styles • We are focusing on Microsoft’s ReactiveExtenions style
  4. Observable • A marriage of Iterables and the Observer Pattern

    • Typical Sequence functions - Map, Filter, Reduce, Take
  5. Observable • A marriage of Iterables and the Observer Pattern

    • Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext
  6. Observable • A marriage of Iterables and the Observer Pattern

    • Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling
  7. Observable • A marriage of Iterables and the Observer Pattern

    • Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay
  8. Observable • A marriage of Iterables and the Observer Pattern

    • Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay • Buffering - Last N events
  9. Observable • A marriage of Iterables and the Observer Pattern

    • Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay • Buffering - Last N events • Composable - SelectMany/FlatMap
  10. Autocomplete • On Keyup • Get the value of the

    field • Only values of length 3 or more • Make remote call • Filter out bad response • Display results
  11. Autocomplete in reality • On Keyup • Get the value

    of the field • Throttle to 500ms • Only values of length 3 or more • Skip duplicates • Make remote call • Filter out bad response • Display results