Effect<Value>.run constructor
const
Effect<Value>.run (
- Value runner(), {
- Value onError(
- Object error,
- StackTrace stackTrace
Runs the synchronous runner immediately when the effect is executed and
emits its return value. Errors can be transformed via onError.
Example:
final generateId = Effect.run(() => uuid.v4());
Implementation
const factory Effect.run(
Value Function() runner, {
Value Function(Object error, StackTrace stackTrace)? onError,
}) = RunEffect<Value>;