object/pipe_compose_utils library
Pipe (chain unary functions). Compose (f(g(x))). Once (run block only once). Roadmap #246-248.
Functions
-
compose<
T, M, R> (R f(M), M g(T)) → R Function(T) -
Returns the mathematical composition
f(g(x)): appliesgfirst, thenf. -
once(
void block()) → void Function() -
Returns a callable that runs
blockonly on its first invocation and is a no-op thereafter. Useful for one-time initialization guards. -
pipe<
T, R> (List< R Function(dynamic)> fns) → R Function(T) -
Builds a function that threads its input left-to-right through
fns, passing each result to the next. Throws a StateError if the final value is not assignable toR.