-
Notifications
You must be signed in to change notification settings - Fork 8
Reactive Operators
richardszalay edited this page May 20, 2011
·
3 revisions
Use this page to find the raix.reactive operator you are looking for. For raix.interactive, see the livedocs.
For more information on how the documentation is formatted, see Documentation Format.
(Users of Rx or RxJs might be interested in the API differences)
I want to create a new sequence | that returns a value | and completes |
value toObservable |
|
multiple times | repeatValue | |||
that never does anything | never | |||
that throws an error | error | |||
that immediately completes | completes | empty | ||
based on an event | fromEvent | |||
that indicates an error | fromErrorEvent | |||
based on a number of events | fromEvents | |||
that indicate an error | fromErrorEvents | |||
that calls a function | with no arguments | start | ||
with arguments that will be determined later | toAsync | |||
that emits values on a timer | interval | |||
timer | ||||
that iterates | over the values in an array |
fromArray toObservable |
||
over values in a numeric range | range | |||
using custom logic | generate | |||
that requests HTTP content | that is XML | xml | ||
urlLoader | ||||
that responds differently to different combinations of events | when | |||
using custom logic | create | |||
createWithCancelable | ||||
decided at subscribe-time | based on a boolean condition | ifElse | ||
from a pre-set set of sequences | lookup | |||
using custom logic | defer | |||
Using an existing sequence | After a period of inactivity | I want to error | timeout | |
I want to switch to another sequence | timeout | |||
I want ensure there is only one value | and error if there are no values or more than one | single | ||
and use the default value if there are no values | singleOrDefault | |||
I want to batch the values | based on time |
bufferWithTime windowWithTime |
||
based on time or count, whichever happens first |
bufferWithTimeOrCount windowWithTimeOrCount |
|||
in batches of a particular size |
bufferWithCount windowWithCount |
|||
until the sequence completes | toArray | |||
using custom logic | and values can be in multiple batches | multiWindow | ||
and values can only be in one batch | window | |||
I want to be notified of messages without affecting them |
peek peekWith |
|||
I want to change its values | map | |||
I want to change the scheduler that routes | calls to subscribe | subscribeOn | ||
messages | observeOn | |||
I want to combine it with another | And be notified when both have completed | forkJoin (inst) | ||
I want to delay messages by a specific amount of time | delay | |||
I want to enforce that all values are a specific type | cast | |||
I want to group its values based on a key | until the sequence completes | groupBy | ||
and control the lifetime of a group | groupByUntil | |||
I want to hide it’s implementation | asObservable | |||
I want to know how many values it contains | count | |||
I want to know if a condition is satisfied | By all of it’s values | all | ||
By any of it’s values | any | |||
I want to know if it contains a value | contains | |||
I want to log information about it’s values | log | |||
I want to only include values | based on custom logic | filter | ||
of a specific type | ofClass | |||
from the start of the sequence | take | |||
based on custom logic | takeWhile | |||
from the end of the sequence | takeLast | |||
until another sequence emits a value | takeUntil | |||
I want to only take the first value | and error if there are no values | first | ||
and use the default value if there are no values | firstOrDefault | |||
within a time period | sample | |||
I want to only take the last value | and error if there are no values | last | ||
and use the default value if there are no values | lastOrDefault | |||
I want to perform a calculation on its values | a sum | sum | ||
an average | average | |||
using custom logic | and only output the final value | reduce | ||
and output the values as they are calculated | scan | |||
I want to perform complex operations without breaking the fluent calls | let | |||
I want to replay the values to future subscribers |
replay replayDefer |
|||
I want to share a subscription between multiple subscribers | and suppy the last value to future subscribers |
prune pruneDefer |
||
using a specific subject implementation |
multicast multicastDefer |
|||
publish publishDefer |
||||
I want to skip values | altogether | ignoreValues | ||
from the start of the sequence | skip | |||
based on custom logic | skipWhile | |||
from the end of the sequence | skipLast | |||
that have the same value as the previous | distinctUntilChanged | |||
until another sequence emits a value | skipUntil | |||
that occur too frequently | throttle | |||
I want to start a new sequence for each value | and include the values from those sequences as they arrive | mapMany | ||
but limit the number of concurrent sequences | mergeMany | |||
and recursively start a new sequence for each of the new values | expand | |||
and subscribe to them only when the previous one completes | concatMany | |||
and take the values through an asynchronous workflow | chain | |||
and cancel the previous sequence when a new value arrives | switchMany | |||
I want to wrap it with metadata | that describes the message | materialize | ||
that includes the time past since the last value | timeInterval | |||
that includes a timestamp | timestamp | |||
when an error occurs | I want to re-subscribe | retry | ||
I want to start a new sequence | catchError | |||
that depends on the error | catchErrorDefer | |||
when it completes | I want to re-subscribe | repeat | ||
I want to start a new sequence | concat | |||
when it completes or errors | I want to start a new sequence | onErrorResumeNext | ||
when it completes, errors or unsubscribes | I want to execute a function | finallyAction | ||
Using two sequences | I want to decide which to receive values from | based on which one has values first | amb | |
I want to determine if their values are equal | sequenceEqual | |||
I want to combine their values | in order | reusing the latest value when unchanged | combineLatest | |
using each value only once | zip | |||
that share overlapping “lifetime” that I choose | and be notified for each combination | join | ||
and be given a sequence of “rights” for each “left” | groupJoin | |||
I want to include values from both | merge | |||
I want to combine multiple sequences | And be notified when all have completed | forkJoin | ||
by outputting the values of all of them | merge | |||
by subscribing to each in order | regardless of whether the previous completes or errors | onErrorResumeNext | ||
when the previous completes | concat | |||
when the previous errors | catchErrors | |||
by responding to different combinations of values (join calculus) | when |