Reactive Programming in Practice

(Using Bacon JS)

By Enrique Amodeo / @eamodeorubio

Enrique Amodeo

(who is this guy?)

[Enrique Amodeo, circa 2015]
  • Programming since 1984
  • Currently Software Engineer at SoundCloud
  • Has loved JS since 2005
  • Test infected
  • Enthusiast of the Agile/Lean way
  • Follow me at @eamodeorubio

This talk

  1. Reactive?
  2. Reactive DOM
  3. AJAX the Reactive Way
  4. Nested Streams
  5. Combining Streams
  6. Finishing (touches)
[Learning Behavior-driven Development with JavaScript]

How many results?

 var foundItemCount = streamsOfItems
          .map(".countItems")
          .scan(0, function(currentTotalItems, itemCount) {
            return itemCount >= 0 ? currentTotalItems + itemCount : 0;
          });
  
Original by BaconJS: https://raw.github.com/wiki/baconjs/bacon.js/baconjs-scan.png

How many results?

    
    foundItemCount
            .map(String)
            .assign($('.total-count'), "text");
  

The End

Some questions?

Original by Ethan Lofton: http://bit.ly/1arHGj