Skip to content

createDependence

The createDependence() function creates a typed dependency handler identified by a string name. This handler is then used with F.inject() and matched against the dependencies object passed to F.run() or F.exec().

Interactive example

Syntax

typescript
function createDependence<
	GenericName extends string
>(
	name: GenericName
): DependenceHandlerDefinition<GenericName>

Parameters

  • name: Dependency key used to match a value inside the runner dependency bag.

Return value

A typed dependence handler definition. Once specialized with a type, it can be used with F.inject() to retrieve the matching dependency inside a flow.

See also

  • inject - Requests a dependency from the runner
  • run - Provides dependencies to the flow

Released under the MIT license.