Skip to content

Function1Ops<T0, T1>

extensionFunction1Ops<T0, T1>onT1Function(T0)

Provides additional functions on functions with 1 parameters.

Methods

andThen() extension

T2Function(T0)andThen<T2>(T2Function(T1)fn)

Composes this function with the provided function, this function being applied first.

Available on Function1<T0, T1>, provided by the Function1Ops<T0, T1> extension

Implementation
dart
Function1<T0, T2> andThen<T2>(Function1<T1, T2> fn) => (t0) => fn(this(t0));

compose() extension

T1Function(T2)compose<T2>(T0Function(T2)fn)

Composes this function with the provided function, this function being applied first.

Available on Function1<T0, T1>, provided by the Function1Ops<T0, T1> extension

Implementation
dart
Function1<T2, T1> compose<T2>(Function1<T2, T0> fn) => (t2) => this(fn(t2));