Skip to content

Understanding Operators

RxJS operators are a set of functions for transforming, composing, and controlling Observable data streams.

Operators are usually used in combination with several others, and this is where the "pipeline" comes in.

In RxJS, operators fall into the following categories

List of categories

Each category contains a number of useful operators. See each category for details.

List of Operators

For a detailed description of each operator, click on the link to browse.

List of Operator categories
CategoryOperatorDescription
TransformationmapConverts each value
scanAccumulate values and output intermediate results
reduceAccumulate all values and output only the final result
pairwiseProcesses two consecutive values in pairs
groupByGrouping streams by key
mergeMapParallel execution of asynchronous processing
switchMapExecute only the latest asynchronous processing (cancel older processing)
concatMapExecute asynchronous processes sequentially
exhaustMapIgnore new processes during execution
expandRecursively expand results
bufferPublish values in an array
bufferTimePublish values at specified time intervals
bufferCountPublish values in batches of specified number of values
bufferWhenBuffering with dynamically controlled end conditions
bufferToggleBuffering with independent control of start and end
FilteringfilterOnly let through values that match the condition
takeGet only the first N values
takeLastGet the last N values
takeWhileGet values while the condition is met
skipSkip the first N values
skipLastSkip the last N values
skipWhileSkip values while the condition is satisfied
skipUntilSkip values until another Observable fires
firstGet the first value or the first value satisfying a condition
lastGet the last value or the last value that satisfies the condition
elementAtGet the value at a given index
findFind the first value that satisfies a condition
findIndexGet the index of the first value that satisfies the condition
debounceTimeIssue the last value if no input is received for a specified time
throttleTimePass through the first value and ignore the new value for the specified time
auditTimeIssue last value after specified time
auditIssue last value with custom Observable to control period
sampleTimeSample latest value at specified time interval
ignoreElementsIgnore all values and only pass through completions/errors
distinctRemove all duplicate values (output only unique values)
distinctUntilChangedRemove consecutive duplicate values
distinctUntilKeyChangedDetect only changes in specific properties of an object
Combination (Pipeable)concatWithJoin other Observables in sequence after completion
mergeWithCombine multiple Observables simultaneously
combineLatestWithCombine the latest value of each Observable
zipWithPair values in corresponding order
raceWithAdopt only the first Observable that fires
withLatestFromAppend other latest values to the main stream
mergeAllFlatten Higher-order Observables in parallel
concatAllFlatten Higher-order Observable in sequence
switchAllSwitch to the latest Higher-order Observable
exhaustAllIgnore new Higher-order Observable during execution
combineLatestAllCombines the latest values of all internal Observables
zipAllPair the corresponding values of each internal Observable
UtilitytapPerform side effects (e.g., log output)
finalizePerform post-processing on completion or error
delayDelay all values for a specified time
delayWhenDelay each value dynamically with a separate Observable
timeoutIssue an error if a value does not arrive within a specified time
takeUntilRetrieve values until another Observable issues a value
retryRetry up to specified number of times on error
repeatRepeat a specified number of times after completion
startWithAdds an initial value to the beginning of the stream
toArrayPublish all values together in an array
materializeConvert a notification to a Notification object
dematerializeConvert the Notification object back to a normal notification
observeOnUse the scheduler to control when values are published
subscribeOnUse the scheduler to control when to start subscribing
timestampAdd a timestamp to each value
ConditionaldefaultIfEmptyIf no value is available, issue default value
everyDetermine if all values satisfy the condition
isEmptyDetermines if no value was issued
Error HandlingcatchErrorCatch errors and perform fallback processing
retryRetry a specified number of times on error
retryWhenRetry with custom conditions
MulticastingshareShare Observable among multiple subscribers
shareReplayCache the latest N values and replay them to new subscribers

Released under the CC-BY-4.0 license.