https://pragprog.com/titles/rkrxjs/build-reactive-websites-with-rxjs/
next
, error
, and complete
method. Passed to the callback function of new Observable(), allowing you to pass data to the observable.import { exampleFunction } from 'rxjs';
fromEvent
: create a stream of specific DOM events that happenfromPromise
: converts a promise to an observable for easy use in observable chains (sometimes not needed as you can just pass a Promise)interval
: issues events every x millisecondsof
: creates an observable out of a known sync data sourcetoPromise
: creates a promise that resolves when an obserable completes; useful to pass a Promise into a library or integrate with legacy Promise-based codeimport { exampleOperator } from 'rxjs/operators';
delay
: by millisecondsfilter
: only take some of the events further down the streammap
: transform the valuesmapTo
: replace the value with a new static value (previous value doesn’t matter)mergeMap
: transform the values and then “merge” as in “flatten” as in “returning an array turns into multiple events”repeat
: waits to complete then repeats all the events the number of times specifiedretry
: upon error, retries a set number of times. Useful for Ajaxtake
: unsubscribe after a limited number of valuestakeUntil
: unsubscribe after a different stream emits a value (like an event)tap
: allow observing values without changing them. Also, trigger side effectstoArray
: waits for stream to complete then emits all events as a single array