RunEffect<Value> class final

An effect that runs a synchronous computation and emits the result. See Effect.run.

Inheritance

Constructors

RunEffect(Value runner(), {Value onError(Object error, StackTrace stackTrace)?})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
onError → Value Function(Object error, StackTrace stackTrace)?
final
runner → Value Function()
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancellable({required EffectID id, bool cancelInFlight = false}) Effect<Value>
Associates this effect with id so that it can be cancelled later. Setting cancelInFlight to true cancels any currently running effect that uses the same identifier before starting this one.
inherited
concatenate({required Effect<Value> effect}) Effect<Value>
Convenience helper for sequencing this effect with effect. Both effects run one after the other, preserving emission order.
inherited
debounce({required String id, required Duration interval}) Effect<Value>
Debounces emissions by delaying them until no new values have arrived for the specified interval. Uses the default scheduler for timing.
inherited
debounceWithScheduler<Time, Interval>({required String id, required Interval interval, required Scheduler<Time, Interval> scheduler}) Effect<Value>
Scheduler-aware variant of Effect.debounce that uses the provided scheduler. The same id is reused to cancel pending debounced work.
inherited
delay(Duration duration) Effect<Value>
Delays emissions by duration on the default scheduler, allowing debounced or scheduled work without manually handling timers.
inherited
delayWithScheduler<Time, Interval>(Interval interval, Scheduler<Time, Interval> scheduler) Effect<Value>
Scheduler-aware delay helper that uses the provided scheduler to pause for interval before running the wrapped effect.
inherited
fireAndForget<NewValue>() Effect<NewValue>
Runs the effect but suppresses any emitted values. Useful for fire-and- forget operations where only the side effects matter.
inherited
flatMap<NewValue>(Effect<NewValue> mapper(Value value)) Effect<NewValue>
For each emitted value, invokes mapper to create another effect and flattens the resulting sequence into a single stream of values.
inherited
map<NewValue>(NewValue mapper(Value value)) Effect<NewValue>
Transforms emitted values using mapper before forwarding them to the reducer or downstream effect handler.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(EffectHandler<Value> handler) Future<void>
Executes the effect immediately with the supplied handler. Each effect implementation defines how it schedules work, emits values, and registers disposables.
override
throttle({required EffectID id, required Duration interval, ThrottleDirection direction = ThrottleDirection.leading, bool emitFirst = true}) Effect<Value>
Throttles emissions so that values are produced no more frequently than interval. The default scheduler controls the timing, and direction determines whether leading or trailing values are emitted.
inherited
throttleWithScheduler<Time, Interval>({required EffectID id, required Interval interval, required Scheduler<Time, Interval> scheduler, required ThrottleDirection direction, required bool emitFirst}) Effect<Value>
Scheduler-aware throttle helper that allows custom timing via scheduler and fine-grained control over leading/trailing emission behavior.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited