Skip to content

create

The create() function wraps a generator-based flow function into a reusable flow object that can later be executed with F.run() or composed with F.exec().

Interactive example

Syntax

typescript
function create<
	GenericTheFlowFunction extends TheFlowFunction
>(
	theFunction: GenericTheFlowFunction
): TheFlow<GenericTheFlowFunction>

Parameters

  • theFunction: The generator or async generator function that defines the flow.

Return value

A flow object that stores the provided function and can be executed many times with F.run() or F.exec().

See also

  • run - Executes a created flow
  • exec - Executes a created flow inside another flow

Released under the MIT license.