task library

Classes

Task<A>

Functions

call<A, B>(Task<B> chain) Task<B> Function(Task<A> task)
delay<A>(Duration d) Task<A> Function(Task<A> task)
Pause execution of the task by the given Duration.
Do<A>(DoFunction<A> f) Task<A>
flatMap<A, B>(Task<B> f(A value)) Task<B> Function(Task<A> task)
Transforms a value from a Task into another Task, then flattens the result.
flatMapFirst<A>(Task f(A value)) Task<A> Function(Task<A> task)
Runs the returned Task, but resolves to the result of the previous task. I.e. discards the result.
fromThunk<A>(Lazy<A> f) Task<A>
Create a Task from a thunk / lazy value. A thunk is a function without arguments that returns a value.
map<T, R>(R f(T value)) Task<R> Function(Task<T> task)
Transform the value of a Task with the provided function.
sequence<A>(Iterable<Task<A>> tasks) Task<IList<A>>
Returns a task that maps an Iterable of Task's, into a list of results.
sequenceSeq<A>(Iterable<Task<A>> tasks) Task<IList<A>>
Returns a task the flattens an Iterable of Task's, into a list of results.
tap<A>(FutureOr<void> f(A value)) Task<A> Function(Task<A> task)
Perform a side effect on the value of a Task.
traverseIterable<A, B>(Task<B> f(A a)) Task<IList<B>> Function(Iterable<A>)
traverseIterableSeq<A, B>(Task<B> f(A a)) Task<IList<B>> Function(Iterable<A>)
value<A>(A value) Task<A>
Create a Task that wraps the given value.

Typedefs

DoFunction<A> = Future<A> Function(_DoAdapter $)