RxJs Book
  • Introduction
  • Summary
    • Why RxJS?
    • RxJS Design Guidelines
      • Introduction
      • When To Use RxJS
      • The RxJS Contract
      • Using RxJS
      • Operator Implementations
    • Getting Started With RxJS
      • What Are The Reactive Extensions?
      • Exploring Major Concepts In RxJS
      • Creating And Querying Observable Sequences
        • Creating And Subscribing To Simple Observable Sequences
        • Bridging To Events
        • Bridging To Callbacks
        • Bridging To Promises
        • Generators And Observable Sequences
        • Querying Observable Sequences
        • Error Handling With Observable Sequences
        • Transducers With Observable Sequences
        • Backpressure With Observable Sequences
        • Operators By Category
      • Subjects
      • Scheduling And Concurrency
      • Testing And Debugging
      • Implementing Your Own Operators
    • How Do I...?
      • How Do I Wrap An Existing API?
      • How Do I Integrate jQuery With RxJS?
      • How Do I Integrate Angular.js With RxJS?
      • How Do I Create A Simple Event Emitter?
    • Mapping RxJS From Different Libraries
      • For Bacon.js Users
      • For Async.js Users
    • Config
      • Promise
      • useNativeEvents
    • Helpers
      • defaultComparer
      • defaultSubComparer
      • defaultError
      • identity
      • just
      • isPromise
      • noop
      • pluck
    • Observable
      • Observable Methods
        • amb
        • case
        • catch
        • combineLatest
        • concat
        • create
        • defer
        • empty
        • for | forIn
        • forkJoin
        • from
        • fromCallback
        • fromEvent
        • fromEventPattern
        • fromNodeCallback
        • fromPromise
        • generate
        • generateWithAbsoluteTime
        • generateWithRelativeTime
        • if
        • interval
        • isObservable
        • just | return
        • merge
        • mergeDelayError
        • never
        • of
        • ofWithScheduler
        • onErrorResumeNext
        • pairs
        • range
        • repeat
        • spawn
        • start
        • startAsync
        • throw
        • timer
        • toAsync
        • using
        • when
        • while | whileDo
        • wrap
        • zip
      • Observable Instance Methods
        • amb
        • and
        • asObservable
        • average
        • buffer
        • bufferWithCount
        • bufferWithTime
        • bufferWithTimeOrCount
        • catch
        • combineLatest
        • concat
        • concatAll
        • concatMapObserver | selectConcatObserver
        • controlled
        • count
        • debounce
        • defaultIfEmpty
        • delay
        • delaySubscription
        • dematerialize
        • distinct
        • distinctUntilChanged
        • do | doAction | tap
        • doOnCompleted | tapOnCompleted
        • doOnError | tapOnError
        • doOnNext | tapOnNext
        • doWhile
        • elementAt
        • every
        • expand
        • extend | manySelect
        • filter | where
        • finally
        • find
        • findIndex
        • first
        • flatMap | selectMany
        • flatMapConcat | concatMap
        • flatMapFirst | selectSwitchFirst
        • flatMapLatest
        • flatMapObserver | selectManyObserver
        • flatMapWithMaxConcurrent
        • forkJoin
        • groupBy
        • groupByUntil
        • groupJoin
        • ignoreElements
        • includes
        • indexOf
        • isEmpty
        • join
        • jortSort
        • jortSortUntil
        • last
        • lastIndexOf
        • let | letBind
        • map | select
        • materialize
        • max
        • maxBy
        • merge
        • mergeAll
        • min
        • minBy
        • multicast
        • observeOn
        • onErrorResumeNext
        • pairwise
        • partition
        • pausable
        • pausableBuffered
        • pipe
        • pluck
        • publish
        • publishLast
        • publishValue
        • reduce
        • repeat
        • replay
        • retry
        • retryWhen
        • scan
        • sequenceEqual
        • share
        • shareReplay
        • shareValue
        • single
        • singleInstance
        • skip
        • skipLast
        • skipLastWithTime
        • skipUntil
        • skipUntilWithTime
        • skipWhile
        • skipWithTime
        • slice
        • some
        • startWith
        • subscribe | forEach
        • subscribeOn
        • subscribeOnCompleted
        • subscribeOnError
        • subscribeOnNext
        • sum
        • switch
        • switchFirst
        • take
        • takeLast
        • takeLastBuffer
        • takeLastBufferWithTime
        • takeLastWithTime
        • takeUntil
        • takeUntilWithTime
        • takeWhile
        • takeWithTime
        • thenDo
        • throttle
        • throttleLatest | sample
        • timeInterval
        • timeout
        • timestamp
        • toArray
        • toMap
        • toPromise
        • toSet
        • transduce
        • window
        • windowWithCount
        • windowWithTime
        • windowWithTimeOrCount
        • withLatestFrom
        • zip
        • zipIterable
    • Observer
      • Observer Methods
        • create
        • fromNotifier
      • Observer Instance Methods
        • asObserver
        • checked
        • notifyOn
        • onCompleted
        • onError
        • onNext
        • toNotifier
    • Notification
      • Notification Methods
        • createOnNext
        • createOnError
        • createOnCompleted
      • Notification Instance Methods
        • accept
        • toObservable
      • Notification Properties
        • exception
        • hasValue
        • kind
        • value
    • Subjects
      • Rx.AsyncSubject
      • Rx.BehaviorSubject
      • Rx.ReplaySubject
      • Rx.Subject
    • Schedulers
      • Rx.HistoricalScheduler
      • Rx.Scheduler
      • Rx.VirtualTimeScheduler
    • Disposables
      • Rx.CompositeDisposable
      • Rx.Disposable
      • Rx.RefCountDisposable
      • Rx.SerialDisposable
      • Rx.SingleAssignmentDisposable
    • Testing
      • Rx.ReactiveTest
      • Rx.Recorded
      • Rx.Subscription
      • Rx.TestScheduler
    • Bindings
      • DOM
        • Ajax
          • ajax
          • ajaxCold
          • get
          • get_Json
          • post
        • JSONP
          • jsonpRequest
          • jsonpRequestCold
        • Web Sockets
          • fromWebSocket
        • Web Workers
          • fromWebWorker
        • Mutation Observers
          • fromMutationObserver
        • Geolocation
          • getCurrentPosition
          • watchPosition
        • Schedulers
          • requestAnimationFrame
          • mutationObserver
      • jQuery
      • AngularJS
        • Factories
          • rx
          • observeOnScope
        • Observable Methods
          • safeApply
        • $rootScope Methods
          • $toObservable
          • $eventToObservable
          • $createObservableFunction
      • Facebook React
      • Ractive.js
      • Node.js
        • Callback Handlers
          • fromCallback
          • fromNodeCallback
        • Event Handlers
          • fromEvent
          • toEventEmitter
        • Stream Handlers
          • fromStream
          • fromReadableStream
          • fromWritableStream
          • fromTransformStream
          • writeToStream
  • Recipes
  • Which Operator do I use?
    • Creation Operators
    • Instance Operators
Powered by GitBook
On this page

Was this helpful?

  1. Which Operator do I use?

Instance Operators

PreviousCreation Operators

Last updated 5 years ago

Was this helpful?

Use this page to find the instance operator implemented by the type that fits your needs:

Instance methods

Using an existing sequence

I want to change each value

I want to pull a property off each value

I want to be notified of values without affecting them

I want to include values

based on custom logic

from the start of the sequence

based on custom logic

from the end of the sequence

until another sequence emits a value or completes

I want to ignore values

altogether

from the start of the sequence

based on custom logic

from the end of the sequence

until another sequence emits a value

that have the same value as the previous

that occur too frequently

I want to compute

the sum

of its values

the average

using custom logic

and only output the final value

and output the values as they are calculated

I want to wrap its messages with metadata

that describes each message

that includes the time past since the last value

that includes a timestamp

after a period of inactivity

I want to throw an error

I want to switch to another sequence

I want ensure there is only one value

and throw an error if there are more or less than one value

and use the default value if there are no values

I want to only take the first value

and throw an error if there are no values

and use the default value if there are no values

within a time period

I want to only take the last value

and error if there are no values

and use the default value if there are no values

I want to know how many values it contains

I want to know if it includes a value

I want to know if a condition is satisfied

by any of its values

by all of its values

I want to delay messages by a specific amount of time

based on custom logic

I want to group the values

until the sequence completes

using custom logic

as arrays

as sequences

in batches of a particular size

as arrays

as sequences

based on time

as arrays

as sequences

based on time or count, whichever happens first

as arrays

as sequences

based on a key

until the sequence completes

and control the lifetime of each group

I want to start a new sequence for each value

and emit the values from all sequences in parallel

and emit the values from each sequence in order

and cancel the previous sequence when a new value arrives

and recursively start a new sequence for each new value

and emit values from all sequences depending for onNext, onError, and onCompleted in parallel

and emit values from all sequences depending for onNext, onError, and onCompleted in order

I want to combine it with another

And be notified when both have completed

I want to perform complex operations without breaking the fluent calls

I want to share a subscription between multiple subscribers

using a specific subject implementation

and supply the last value to future subscribers

and replay a default or the latest value to future subscribers

and replay n number of values to future subscribers

when an error occurs

I want to re-subscribe

I want to start a new sequence

that depends on the error

when it completes

I want to re-subscribe

I want to start a new sequence

when it completes or errors

I want to start a new sequence

when it completes, errors or unsubscribes

I want to execute a function

I want to change the scheduler that routes

calls to subscribe

messages

Using two sequences

I want to decide which to receive values from

based on which one has values first

I want to determine if their values are equal

I want to combine their values

only when the first sequence emits, using the latest value from each

in order

reusing the latest value when unchanged

using each value only once

that share overlapping “lifetime” that I choose

and be notified for each combination

and be given a sequence of “rights” for each “left”

I want to include values from both

See Also ##

Reference

Concepts

Observable
Observable
Querying Observable Sequences
Operators By Category
map/select
pluck
do/tap
doOnNext/tapOnNext
doOnError/tapOnError
doOnCompleted/tapOnCompleted
filter/where
take
takeWhile
takeLast
takeUntil
ignoreElements
skip
skipWhile
skipLast
skipUntil
distinctUntilChanged
throttle
sum
average
aggregate
reduce
scan
materialize
timeInterval
timestamp
timeout
timeout
single
singleOrDefault
first
firstOrDefault
sample
last
lastOrDefault
count
contains
any/some
all/every
delay
delayWithSelector
toArray
toMap
toSet
buffer
window
bufferWithCount
windowWithCount
bufferWithTime
windowWithTime
bufferWithTimeOrCount
windowWithTimeOrCount
groupBy
groupByUntil
flatMap/selectMany
concatMap/selectConcat
flatMapLatest/selectSwitch
expand
flatMapObserver/selectManyObserver
concatMapObserver/selectConcatObserver
forkJoin
let
multicast
publish
share
publishLast
shareLast
publishValue
shareValue
replay
shareReplay
retry
catch
catch
repeat
concat
onErrorResumeNext
finally
subscribeOn
observeOn
amb
sequenceEqual
withLatestFrom
combineLatest
zip
join
groupJoin
merge