- combineAll
- combineLatest
- concat - Subscribe to Observables in order as previous completes, emit values. (The next transaction (subscription) cannot start until the previous completes!)
- concatAll
- forkJoin
- merge - Turn multiple Observables into a single observable.
- mergeAll - Collect and subscribe to all observables.
- race
- startsWith
- withLatestFrom
- zip
Last active
April 1, 2019 15:27
-
-
Save jxc876/fa75eefac584c2b2bd1b1e579e65c3d4 to your computer and use it in GitHub Desktop.
Gist
- audit
- auditTime
- debounce
- debounceTime
- distinctUntilChanged
- filter - Emit values that pass the provided condition.
- first
- ignoreElements
- last
- sample
- single
- skip - Skip the provided number of emitted values. (ignore the first x emissions from the source)
- skipUntil
- skipWhile
- take - Emit provided number of values before completing. (When you are interested in only the first set number of emission)
- takeUntil - Emit values until provided Observable emits.
- takeWhile
- throttle
- throttleTime
- do / tap - Transparently perform actions or side-effects, such as logging.
- delay
- delayWhen
- finalize / finally
- let
- repeat
- toPromise
- timeout
- throwError
- Hot vs Cold Observables
- A Producer is the source of values for your Observable (ex: Web Socket, DOM events, iterator, loop), observer.next(value)
import { Observable } from 'rxjs';
let observable = new Observable(subscriber => {
subscriber.next(1);
subscriber.next(2);
subscriber.complete();
});
new Promise((resolve, reject) => reject('Rejected!'));
Flattening - subscribing to an observable
someObservable = of(..)
someObservable.pipe(
map(..)
)
.subscribe(result
// observable
)
standalone
someObservable.pipe(
map(..),
mergeAll
)
mapping + flattening:
someObservable.pipe(
mergeMap()
)
- buffer
- bufferCount
- bufferTime
- bufferToggle
- bufferWhen
- concatMap - Queue every observable, subscribe only when last observable completes "Wait In Line". (does not subscribe to the next observable until the previous completes)
- concatMapTo
- expand
- exhaustMap - IGNORES new observables while current is emitting values "Do Not Disturb"
- groupBy
- map
- mapTo
- mergeMap / flatMap - Keep subscribing to every new observable "No strategy, Lazy". (more than one inner subscription maintained)
- partition
- pluck
- reduce
- scan
- switchMap - Unsubscribe from last observable when a NEW one arrives - "Latest & Greatest" (maintains only one inner subscription at a time)
- toArray
- window
- windowCount
- windowTime
- windowToggle
- windowWhen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment