ReactiveX Library • ReactiveX is a library for composing async events using the observer pattern • ReactiveX is a combination of the best ideas from the Observer pattern, the Iterator pattern, and functional programming • The observer pattern is a software design pattern where a subject maintains a list of listeners (observers) and notifies them of any changes. • ReactiveX is not specific to JavaScript and there are implementation for other languages such as RxJava, RxDart, RxPHP, RxGo, etc.
listener to observable • Subscription – execution of observable • Operators – pure function for transforming streams • Subject – Allow multiple observers • Schedulers – control concurrency, enable coordination
multicast to many Observers. • They maintain a registry of many listeners. • Every Subject is an Observable • Observer can not distinguish between an Observable and a Subject • Unlike Observables, subscribe doesn’t invoke execution, it simply registers the observer
as the current value • Emits the current value in store whenever a new observer subscribes • Must be initialized by a value • Example personal age or total vote count.