RxCommandAsync<TParam, TResult> class
- Inheritance
- Object
- RxCommand<TParam, TResult>
- RxCommandAsync
Constructors
-
RxCommandAsync(AsyncFunc1<TParam, TResult> func, Observable<bool> canExecute, bool emitInitialCommandResult, bool emitLastResult, bool emitsLastValueToNewSubscriptions)
-
factory
Properties
-
canExecute
→ Observable<bool>
-
Observable stream that issues a bool on any change of the current executable state of the command.
Meaning if the command cann be executed or not. This will issue
false
while the command executes
but also if the command receives a false from the canExecute Observable that you can pass when creating the Command
read-only, inherited
-
first
→ AsObservableFuture<CommandResult<TResult>>
-
The first element of the stream. [...]
read-only, inherited
-
hashCode
→ int
-
The hash code for this object. [...]
read-only, inherited
-
isBroadcast
→ bool
-
Whether this stream is a broadcast stream.
read-only, inherited
-
isEmpty
→ AsObservableFuture<bool>
-
Whether this stream contains any elements. [...]
read-only, inherited
-
isExecuting
→ Observable<bool>
-
Observable stream that issues a bool on any execution state change of the command
read-only, inherited
-
last
→ AsObservableFuture<CommandResult<TResult>>
-
The last element of this stream. [...]
read-only, inherited
-
lastResult
↔ TResult
-
The result of the last sucessful call to execute
read / write, inherited
-
length
→ AsObservableFuture<int>
-
The number of elements in this stream. [...]
read-only, inherited
-
results
→ Observable<TResult>
-
Observable stream that outputs any result from the called handler function. If the handler function has void return type
it will still output one
Null
item so that you can listen for the end of the execution.
read-only, inherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
read-only, inherited
-
single
→ AsObservableFuture<CommandResult<TResult>>
-
The single element of this stream. [...]
read-only, inherited
-
throwExceptions
↔ bool
-
By default
RxCommand
will catch all exceptions during exceution of the command. And publish them on .thrownExceptions
and in the CommandResult
. If don't want this and have exceptions thrown, set this to true.
read / write, inherited
-
thrownExceptions
→ Observable<Exception>
-
When subribing to
thrownExceptions
you will every excetpion that was thrown in your handler function as an event on this Observable.
If no subscription exists the Exception will be rethrown
read-only, inherited
Methods
-
execute([TParam param ])
→ void
-
Calls the wrapped handler function with an option input parameter
-
any(bool test(T element))
→ AsObservableFuture<bool>
-
Checks whether
test
accepts any element provided by this stream. [...]
inherited
-
asBroadcastStream({void onListen(StreamSubscription<T> subscription), void onCancel(StreamSubscription<T> subscription) })
→ Observable<CommandResult<TResult>>
-
Returns a multi-subscription stream that produces the same events as this. [...]
inherited
-
asyncExpand<S>(Stream<S> mapper(T value))
→ Observable<S>
-
Maps each emitted item to a new
Stream
using the given mapper, then
subscribes to each new stream one after the next until all values are
emitted. [...]
inherited
-
asyncMap<S>(FutureOr<S> convert(T value))
→ Observable<S>
-
Creates an Observable with each data event of this stream asynchronously
mapped to a new event. [...]
inherited
-
buffer(SamplerBuilder<CommandResult<TResult>, List<CommandResult<TResult>>> sampler)
→ Observable<List<CommandResult<TResult>>>
-
Creates an Observable where each item is a
List
containing the items
from the source sequence, batched by the sampler
. [...]
inherited
-
bufferCount(int count, [ int skip ])
→ Observable<List<CommandResult<TResult>>>
-
Creates an Observable where each item is a
List
containing the items
from the source sequence, in batches of count
. [...]
inherited
-
bufferFuture<O>(Future<O> onFutureHandler())
→ Observable<List<CommandResult<TResult>>>
-
Creates an Observable where each item is a
List
containing the items
from the source sequence, batched whenever onFutureHandler
completes. [...]
inherited
-
bufferTest(bool onTestHandler(T event))
→ Observable<List<CommandResult<TResult>>>
-
Creates an Observable where each item is a
List
containing the items
from the source sequence, batched whenever onTestHandler
passes. [...]
inherited
-
bufferTime(Duration duration)
→ Observable<List<CommandResult<TResult>>>
-
Creates an Observable where each item is a
List
containing the items
from the source sequence, sampled on a time frame with duration
. [...]
inherited
-
bufferWhen<O>(Stream<O> other)
→ Observable<List<CommandResult<TResult>>>
-
Creates an Observable where each item is a
List
containing the items
from the source sequence, sampled on onStream
. [...]
inherited
-
bufferWithCount(int count, [ int skip ])
→ Observable<List<CommandResult<TResult>>>
-
Deprecated: Please use bufferCount [...]
inherited
-
call([TParam param ])
→ void
-
inherited
-
cast<R>()
→ Observable<R>
-
Adapt this stream to be a
Stream<R>
. [...]
inherited
-
concatMap<S>(Stream<S> mapper(T value))
→ Observable<S>
-
Maps each emitted item to a new
Stream
using the given mapper, then
subscribes to each new stream one after the next until all values are
emitted. [...]
inherited
-
concatWith(Iterable<Stream<CommandResult<TResult>>> other)
→ Observable<CommandResult<TResult>>
-
Returns an Observable that emits all items from the current Observable,
then emits all items from the given observable, one after the next. [...]
inherited
-
contains(Object needle)
→ AsObservableFuture<bool>
-
Returns whether
needle
occurs in the elements provided by this stream. [...]
inherited
-
debounce(Duration duration)
→ Observable<CommandResult<TResult>>
-
Creates an Observable that will only emit items from the source sequence
if a particular time span has passed without the source sequence emitting
another item. [...]
inherited
-
defaultIfEmpty(CommandResult<TResult> defaultValue)
→ Observable<CommandResult<TResult>>
-
Emit items from the source Stream, or a single default item if the source
Stream emits nothing. [...]
inherited
-
delay(Duration duration)
→ Observable<CommandResult<TResult>>
-
The Delay operator modifies its source Observable by pausing for
a particular increment of time (that you specify) before emitting
each of the source Observable’s items.
This has the effect of shifting the entire sequence of items emitted
by the Observable forward in time by that specified increment. [...]
inherited
-
dematerialize<S>()
→ Observable<S>
-
Converts the onData, onDone, and onError
Notification
objects from a
materialized stream into normal onData, onDone, and onError events. [...]
inherited
-
dispose()
→ void
-
If you don't need a command any longer it is a good practise to
dispose it to make sure all stream subsriptions are cancelled to prevent memory leaks
inherited
-
distinct([bool equals(T previous, T next) ])
→ Observable<CommandResult<TResult>>
-
WARNING: More commonly known as distinctUntilChanged in other Rx
implementations. Creates an Observable where data events are skipped if
they are equal to the previous data event. [...]
inherited
-
distinctUnique({bool equals(T e1, T e2), int hashCode(T e) })
→ Observable<CommandResult<TResult>>
-
WARNING: More commonly known as distinct in other Rx implementations.
Creates an Observable where data events are skipped if they have already
been emitted before. [...]
inherited
-
doOnCancel(void onCancel())
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream subscription is
cancelled. Often called doOnUnsubscribe or doOnDispose in other
implementations. [...]
inherited
-
doOnData(void onData(T event))
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream emits an item. In
other implementations, this is called doOnNext. [...]
inherited
-
doOnDone(void onDone())
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream finishes emitting
items. In other implementations, this is called doOnComplete(d). [...]
inherited
-
doOnEach(void onEach(Notification<T> notification))
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream emits data, emits
an error, or emits done. The callback receives a
Notification
object. [...]
inherited
-
doOnError(Function onError)
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream emits an error. [...]
inherited
-
doOnListen(void onListen())
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream is first listened to. [...]
inherited
-
doOnPause(void onPause(Future resumeSignal))
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream subscription is
paused. [...]
inherited
-
doOnResume(void onResume())
→ Observable<CommandResult<TResult>>
-
Invokes the given callback function when the stream subscription
resumes receiving items. [...]
inherited
-
drain<S>([S futureValue ])
→ AsObservableFuture<S>
-
Discards all data on the stream, but signals when it's done or an error
occurred. [...]
inherited
-
elementAt(int index)
→ AsObservableFuture<CommandResult<TResult>>
-
Returns the value of the
index
th data event of this stream. [...]
inherited
-
every(bool test(T element))
→ AsObservableFuture<bool>
-
Checks whether
test
accepts all elements provided by this stream. [...]
inherited
-
exhaustMap<S>(Stream<S> mapper(T value))
→ Observable<S>
-
Converts items from the source stream into a new Stream using a given
mapper. It ignores all items from the source stream until the new stream
completes. [...]
inherited
-
expand<S>(Iterable<S> convert(T value))
→ Observable<S>
-
Creates an Observable from this stream that converts each element into
zero or more events. [...]
inherited
-
firstWhere(bool test(T element), { dynamic defaultValue(), CommandResult<TResult> orElse() })
→ AsObservableFuture<CommandResult<TResult>>
-
Finds the first element of this stream matching
test
. [...]
inherited
-
flatMap<S>(Stream<S> mapper(T value))
→ Observable<S>
-
Converts each emitted item into a new Stream using the given mapper
function. The newly created Stream will be be listened to and begin
emitting items downstream. [...]
inherited
-
flatMapIterable<S>(Stream<Iterable<S>> mapper(T value))
→ Observable<S>
-
Converts each item into a new Stream. The Stream must return an
Iterable. Then, each item from the Iterable will be emitted one by one. [...]
inherited
-
flatMapLatest<S>(Stream<S> mapper(T value))
→ Observable<S>
-
Deprecated: Please use switchMap instead. [...]
inherited
-
fold<S>(S initialValue, S combine(S previous, T element))
→ AsObservableFuture<S>
-
Combines a sequence of values by repeatedly applying
combine
. [...]
inherited
-
forEach(void action(T element))
→ AsObservableFuture
-
Executes
action
on each element of the stream. [...]
inherited
-
handleError(Function onError, { bool test(dynamic error) })
→ Observable<CommandResult<TResult>>
-
Creates a wrapper Stream that intercepts some errors from this stream. [...]
inherited
-
ignoreElements()
→ Observable<CommandResult<TResult>>
-
Creates an Observable where all emitted items are ignored, only the
error / completed notifications are passed [...]
inherited
-
interval(Duration duration)
→ Observable<CommandResult<TResult>>
-
Creates an Observable that emits each item in the Stream after a given
duration. [...]
inherited
-
join([String separator = "" ])
→ AsObservableFuture<String>
-
Combines the string representation of elements into a single string. [...]
inherited
-
lastWhere(bool test(T element), { Object defaultValue(), CommandResult<TResult> orElse() })
→ AsObservableFuture<CommandResult<TResult>>
-
Finds the last element in this stream matching
test
. [...]
inherited
-
listen(void onData(T event), { Function onError, void onDone(), bool cancelOnError })
→ StreamSubscription<CommandResult<TResult>>
-
Adds a subscription to this stream. Returns a
StreamSubscription
which
handles events from the stream using the provided onData
, onError
and
onDone
handlers. [...]
inherited
-
map<S>(S convert(T event))
→ Observable<S>
-
Maps values from a source sequence through a function and emits the
returned values. [...]
inherited
-
materialize()
→ Observable<Notification<CommandResult<TResult>>>
-
Converts the onData, on Done, and onError events into
Notification
objects that are passed into the downstream onData listener. [...]
inherited
-
max([Comparator<CommandResult<TResult>> comparator ])
→ AsObservableFuture<CommandResult<TResult>>
-
Converts a Stream into a Future that completes with the largest item emitted
by the Stream. [...]
inherited
-
mergeWith(Iterable<Stream<CommandResult<TResult>>> streams)
→ Observable<CommandResult<TResult>>
-
Combines the items emitted by multiple streams into a single stream of
items. The items are emitted in the order they are emitted by their
sources. [...]
inherited
-
min([Comparator<CommandResult<TResult>> comparator ])
→ AsObservableFuture<CommandResult<TResult>>
-
Converts a Stream into a Future that completes with the smallest item
emitted by the Stream. [...]
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a non-existent method or property is accessed. [...]
inherited
-
ofType<S>(TypeToken<S> typeToken)
→ Observable<S>
-
Filters a sequence so that only events of a given type pass [...]
inherited
-
onErrorResume(Stream<CommandResult<TResult>> recoveryFn(dynamic error))
→ Observable<CommandResult<TResult>>
-
Intercepts error events and switches to a recovery stream created by the
provided
recoveryFn
. [...]
inherited
-
onErrorResumeNext(Stream<CommandResult<TResult>> recoveryStream)
→ Observable<CommandResult<TResult>>
-
Intercepts error events and switches to the given recovery stream in
that case [...]
inherited
-
onErrorReturn(CommandResult<TResult> returnValue)
→ Observable<CommandResult<TResult>>
-
instructs an Observable to emit a particular item when it encounters an
error, and then terminate normally [...]
inherited
-
onErrorReturnWith(CommandResult<TResult> returnFn(dynamic error))
→ Observable<CommandResult<TResult>>
-
instructs an Observable to emit a particular item created by the
returnFn
when it encounters an error, and then terminate normally. [...]
inherited
-
pipe(StreamConsumer<CommandResult<TResult>> streamConsumer)
→ AsObservableFuture
-
Pipes the events of this stream into
streamConsumer
. [...]
inherited
-
reduce(CommandResult<TResult> combine(T previous, T element))
→ AsObservableFuture<CommandResult<TResult>>
-
Combines a sequence of values by repeatedly applying
combine
. [...]
inherited
-
repeat(int repeatCount)
→ Observable<CommandResult<TResult>>
-
Creates an Observable that repeats the source's elements the specified
number of times. [...]
inherited
-
sample(Stream sampleStream)
→ Observable<CommandResult<TResult>>
-
Returns an Observable that, when the specified sample stream emits
an item or completes, emits the most recently emitted item (if any)
emitted by the source stream since the previous emission from
the sample stream. [...]
inherited
-
scan<S>(S accumulator(S accumulated, T value, int index), [ S seed ])
→ Observable<S>
-
Applies an accumulator function over an observable sequence and returns
each intermediate result. The optional seed value is used as the initial
accumulator value. [...]
inherited
-
singleWhere(bool test(T element), { CommandResult<TResult> orElse() })
→ AsObservableFuture<CommandResult<TResult>>
-
Finds the single element in this stream matching
test
. [...]
inherited
-
skip(int count)
→ Observable<CommandResult<TResult>>
-
Skips the first count data events from this stream. [...]
inherited
-
skipUntil<S>(Stream<S> otherStream)
→ Observable<CommandResult<TResult>>
-
Starts emitting items only after the given stream emits an item. [...]
inherited
-
skipWhile(bool test(T element))
→ Observable<CommandResult<TResult>>
-
Skip data events from this stream while they are matched by test. [...]
inherited
-
startWith(CommandResult<TResult> startValue)
→ Observable<CommandResult<TResult>>
-
Prepends a value to the source Observable. [...]
inherited
-
startWithMany(List<CommandResult<TResult>> startValues)
→ Observable<CommandResult<TResult>>
-
Prepends a sequence of values to the source Observable. [...]
inherited
-
switchIfEmpty(Stream<CommandResult<TResult>> fallbackStream)
→ Observable<CommandResult<TResult>>
-
When the original observable emits no items, this operator subscribes to
the given fallback stream and emits items from that observable instead. [...]
inherited
-
switchMap<S>(Stream<S> mapper(T value))
→ Observable<S>
-
Converts each emitted item into a new Stream using the given mapper
function. The newly created Stream will be be listened to and begin
emitting items, and any previously created Stream will stop emitting. [...]
inherited
-
take(int count)
→ Observable<CommandResult<TResult>>
-
Provides at most the first
n
values of this stream.
Forwards the first n data events of this stream, and all error events, to
the returned stream, and ends with a done event. [...]
inherited
-
takeUntil<S>(Stream<S> otherStream)
→ Observable<CommandResult<TResult>>
-
Returns the values from the source observable sequence until the other
observable sequence produces a value. [...]
inherited
-
takeWhile(bool test(T element))
→ Observable<CommandResult<TResult>>
-
Forwards data events while test is successful. [...]
inherited
-
throttle(Duration duration)
→ Observable<CommandResult<TResult>>
-
Returns an Observable that emits only the first item emitted by the source
Observable during sequential time windows of a specified duration. [...]
inherited
-
timeInterval()
→ Observable<TimeInterval<CommandResult<TResult>>>
-
Records the time interval between consecutive values in an observable
sequence. [...]
inherited
-
timeout(Duration timeLimit, { void onTimeout(EventSink<T> sink) })
→ Observable<CommandResult<TResult>>
-
The Timeout operator allows you to abort an Observable with an onError
termination if that Observable fails to emit any items during a specified
duration. You may optionally provide a callback function to execute on
timeout.
inherited
-
timestamp()
→ Observable<Timestamped<CommandResult<TResult>>>
-
Wraps each item emitted by the source Observable in a
Timestamped
object
that includes the emitted item and the time when the item was emitted. [...]
inherited
-
toList()
→ AsObservableFuture<List<CommandResult<TResult>>>
-
Collects all elements of this stream in a
List
. [...]
inherited
-
toSet()
→ AsObservableFuture<Set<CommandResult<TResult>>>
-
Collects the data of this stream in a
Set
. [...]
inherited
-
toString()
→ String
-
Returns a string representation of this object.
inherited
-
transform<S>(StreamTransformer<CommandResult<TResult>, S> streamTransformer)
→ Observable<S>
-
Applies a
StreamTransformer
to the current stream. [...]
inherited
-
where(bool test(T event))
→ Observable<CommandResult<TResult>>
-
Filters the elements of an observable sequence based on the test.
inherited
-
window(SamplerBuilder<CommandResult<TResult>, Stream<CommandResult<TResult>>> sampler)
→ Observable<Stream<CommandResult<TResult>>>
-
Creates an Observable where each item is a
Stream
containing the items
from the source sequence, batched by the sampler
. [...]
inherited
-
windowCount(int count, [ int skip ])
→ Observable<Stream<CommandResult<TResult>>>
-
Creates an Observable where each item is a
Stream
containing the items
from the source sequence, in batches of count
. [...]
inherited
-
windowFuture<O>(Future<O> onFutureHandler())
→ Observable<Stream<CommandResult<TResult>>>
-
Creates an Observable where each item is a
Stream
containing the items
from the source sequence, batched whenever onFutureHandler
completes. [...]
inherited
-
windowTest(bool onTestHandler(T event))
→ Observable<Stream<CommandResult<TResult>>>
-
Creates an Observable where each item is a
Stream
containing the items
from the source sequence, batched whenever onTestHandler
passes. [...]
inherited
-
windowTime(Duration duration)
→ Observable<Stream<CommandResult<TResult>>>
-
Creates an Observable where each item is a
Stream
containing the items
from the source sequence, sampled on a time frame with duration
. [...]
inherited
-
windowWhen<O>(Stream<O> other)
→ Observable<Stream<CommandResult<TResult>>>
-
Creates an Observable where each item is a
Stream
containing the items
from the source sequence, sampled on onStream
. [...]
inherited
-
windowWithCount(int count, [ int skip ])
→ Observable<Stream<CommandResult<TResult>>>
-
Deprecated: Please use windowCount [...]
inherited
-
withLatestFrom<S, R>(Stream<S> latestFromStream, R fn(T t, S s))
→ Observable<R>
-
Creates an Observable that emits when the source stream emits, combining
the latest values from the two streams using the provided function. [...]
inherited
-
zipWith<S, R>(Stream<S> other, R zipper(T t, S s))
→ Observable<R>
-
Returns an Observable that combines the current stream together with
another stream using a given zipper function. [...]
inherited
Operators
-
operator ==(dynamic other)
→ bool
-
The equality operator. [...]
inherited