Slide 1

Slide 1 text

carbonfive.com Composing Reactive Software Michael Avila • [email protected]

Slide 2

Slide 2 text

Agenda ● Insufficient overview ● Important, but poorly explained idea ● Vague and unjustified conclusion ● Questions

Slide 3

Slide 3 text

Agenda (revised) ● Reactive Programming ● Signal Graph ● Conclusion ● Questions

Slide 4

Slide 4 text

Reactive Programming

Slide 5

Slide 5 text

“... programming with asynchronous data streams ...”

Slide 6

Slide 6 text

interface Observable { subscribe( onNext: (T) => void, onError: (Error) => void, onCompleted: () => void, ): Subscription; map( (T) => V): Observable; flatMap((T) => Observable): Observable; scan( (V, T) => V, V): Observable; filter( (T) => boolean): Observable; withLatestFrom(Observable, ...): Observable<[T, V, ...]>; combineLatest( Observable, ...): Observable<[T, V, ...]>; … any many more! }

Slide 7

Slide 7 text

Operators buffer bufferCount bufferTime bufferToggle bufferWhen combineAll combineLatest concat concatAll concatMap concatMapTo count debounce debounceTime defaultIfEmpty delay delayWhen dematerialize distinctUntilChanged do every expand filter first groupBy ignoreElements last let map mapTo merge mergeMap partition pluck publish race repeat retry retryWhen sample scan share single skip skipUntil skipWhile startWith switchMap window windowCount windowTime windowToggle windowWhen withLatestFrom zip … and probably more

Slide 8

Slide 8 text

const email$ = Observable.fromEvent(......); const password$ = Observable.fromEvent(......); const login$ = Observable.fromEvent(......); const activeUser = login$ .withLatestFrom(email$, password$) .flatMap(([_, email, password]) => { return Observable.ajax.post('/auth/', { email, password }) .map(({ response }) => response); }); activeUser.subscribe(...
...);

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Signal Graph

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Additional Notes ➔ Asynchronous ➔ Lazy* ➔ Composable

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

Good?

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

¯\_(ツ)_/¯

Slide 34

Slide 34 text

Good! I think.

Slide 35

Slide 35 text

carbonfive.com Thanks!