fromFunction<RunInput extends Object, RunOutput extends Object> static method
Runnable<RunInput, RunnableOptions, RunOutput>
fromFunction<RunInput extends Object, RunOutput extends Object>({
- FutureOr<
RunOutput> invoke(- RunInput input,
- RunnableOptions? options
- Stream<
RunOutput> stream(- Stream<
RunInput> inputStream, - RunnableOptions? options
- Stream<
Creates a RunnableFunction from a Dart function.
A RunnableFunction allows you to run a Dart function as part of a chain.
function
- the function to run.
Implementation
static Runnable<RunInput, RunnableOptions, RunOutput>
fromFunction<RunInput extends Object, RunOutput extends Object>({
final FutureOr<RunOutput> Function(
RunInput input,
RunnableOptions? options,
)? invoke,
final Stream<RunOutput> Function(
Stream<RunInput> inputStream,
RunnableOptions? options,
)? stream,
}) {
return RunnableFunction<RunInput, RunOutput>(
invoke: invoke,
stream: stream,
);
}