Compose2<Input1, Input2, Output> class
Compose a series of functions, the output of the previous function in the chain is automatically passed as input to the next function in the chain.
int sub(int a, int b) => a - b;
/// Compose two inputs 2️⃣
final compose2 = const Compose2(sub, 2, 4).c2(sub, 2);
Used to compose functions with two inputs of type Input1
and Input2
.
If the function has a different number of inputs, use Compose1
, Compose3
(coming soon), etc.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
c1<
ComposedOutput> (ComposedOutput c1Compose(Output output)) → _ChainCompose21< Input1, Input2, Output, ComposedOutput> -
Chain a function that takes the output
Output
from this Compose2 and returns a new Compose that when called will executec1Compose
, returning a value of typeComposedOutput
. -
c2<
ComposedInput, ComposedOutput> (ComposedOutput c2Compose(Output output, ComposedInput c2input), ComposedInput composedInput) → _ChainCompose22< Input1, Input2, Output, ComposedInput, ComposedOutput> - Chain a function that takes two inputs:
-
call(
) → Output - Compute the result of the chain.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator *(
Compose2< Input2, Output, Output> other(Output output, Input2 input2)) → _ChainCompose22<Input1, Input2, Output, Input2, Output> -
Chain two Compose2. The second operand must have inputs of type
Output
andInput2
and must returnOutput
. -
operator ==(
Object other) → bool -
The equality operator.
inherited