Tyrannosaurus Rx

James Hughes
September 03, 2014

Tyrannosaurus Rx

Basic overview of Rx (Reactive Extensions)

James Hughes

September 03, 2014

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

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