KEMBAR78
Reactive Programming and RxJS | PPTX
Reactive Programming
and RxJS
by Denis Gorbunov
In computing, reactive programming is
a programming paradigm oriented
around data flows and the propagation
of change.
wikipedia.org
Systems built as Reactive Systems are
more flexible, loosely-coupled and
scalable. This makes them easier to
develop and amenable to change.
They are significantly more tolerant of
failure and when failure does occur they
meet it with elegance rather than disaster.
Reactive Systems are highly responsive,
giving users effective interactive feedback.
reactivemanifesto.org
reactivex.io
Java: RxJava
JavaScript: RxJS
C#: Rx.NET
C#(Unity): UniRx
Scala: RxScala
Clojure: RxClojure
C++: RxCpp
Ruby: Rx.rb
Python: RxPY
Groovy: RxGroovy
JRuby: RxJRuby
Kotlin: RxKotlin
Swift: RxSwift
PHP: RxPHP
reactivex.io
Java: RxJava
JavaScript: RxJS
C#: Rx.NET
C#(Unity): UniRx
Scala: RxScala
Clojure: RxClojure
C++: RxCpp
Ruby: Rx.rb
Python: RxPY
Groovy: RxGroovy
JRuby: RxJRuby
Kotlin: RxKotlin
Swift: RxSwift
PHP: RxPHP
ReactiveX is a combination of the best ideas from
the Observer pattern, the Iterator pattern, and
functional programming
reactivex.io
Observable and Observer
RxJS: Operators
ReactiveX provides a collection of operators with which you can
filter, select, transform, combine, and compose Observables.
This allows for efficient execution and composition.
RxJS: Operators
• buffer
• bufferCount
• bufferTime
• bufferToggle
• bufferWhen
• cache
• catch
• combineAll
• combineLatest
• concat
• concatAll
• concatMap
• concatMapTo
• create
• debounce
• debounceTime
• defaultIfEmpty
• distinctUntilCha
nged
• delay
• delayWhen
• do
• every
• empty
• expand
• filter
• first
• forkJoin
• from
• fromEvent
• fromPromise
• groupBy
• ignoreElements
• interval
• last
• let
• map
• mapTo
• merge
• mergeAll
• mergeMap
RxJS: Operators
• multicast
• of
• partition
• pluck
• publish
• race
• range
• retry
• retryWhen
• sample
• share
• single
• skip
• skipUntil
• skipWhile
• startWith
• take
• takeUntil
• takeWhile
• throttle
• throttleTime
• throw
• timer
• toPromise
• scan
• switchMap
• window
• windowCount
• windowTime
• windowToggle
• windowWhen
• withLatestFrom
• zip
map
rxmarbles.com
switchMap
combineLatest
rxmarbles.com
debounce
rxmarbles.com
filter
rxmarbles.com
find
rxmarbles.com
reduce
rxmarbles.com
scan
rxmarbles.com
takeUntil
rxmarbles.com
merge
rxmarbles.com
distinct
rxmarbles.com
distinctUntilChanged
rxmarbles.com
Subject
Subject
Subject
Subject
Subject
Hot and Cold Observables
medium.com/@benlesh
Observables are functions that tie an
observer to a producer.
RxJS: Observable and Observer
Hot and Cold Observables
COLD is when your observable creates the producer
medium.com/@benlesh
Hot and Cold Observables
COLD is when your observable creates the producer
HOT is when your observable closes over the producer
medium.com/@benlesh
Hot and Cold Observables
COLD is when your observable creates the producer
HOT is when your observable closes over the producer
medium.com/@benlesh
Unsubscribe
Unsubscribe
medium.com/@benlesh
• take(n): emits N values before stopping the
observable.
• takeWhile(predicate): tests the emitted values
against a predicate, if it returns `false`, it will
complete.
• first(): emits the first value and completes.
• first(predicate): checks each value against a
predicate function, if it returns `true`, the emits
that value and completes.

Reactive Programming and RxJS