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

Tyrannosaurus Rx

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
James Hughes
September 03, 2014

Tyrannosaurus Rx

Basic overview of Rx (Reactive Extensions)

James Hughes

September 03, 2014

Transcript

42 slides
  1. var list = [1,2,3,4,5,6,7]; ! for(var i = 0; i

    < list.length; i++) { console.log(list[i]) }
  2. CREATING OBSERVABLES class _ extends Subscriber<String> { void onCompleted() {}

    void onError(Throwable t) {} void onNext(String s){} }
  3. TRANSFORMING OBSERVABLES Observable ints = Observable .interval(1, SECONDS); ! ints.map((i)

    -> i + 1) .map((i) -> i + “ seconds”) .subscribe(out::println)
  4. COMBINING OBSERVABLES Observable goodies = Observable.from( new String[]{ "Batman", "Robin",

    "Alfred", “Batgirl"}); ! goodies.zipWith(baddies, (g,b) -> g + " punches " + b)
  5. COMBINING OBSERVABLES Batman punches The Joker Robin punches The Riddler

    Alfred punches Penguin Batgirl punches Catwoman

More Decks by James Hughes

Other Decks in Programming