Skip to content

Type Alias: InjectionFallback<F>

ts
type InjectionFallback<F> = 
  | F
  | ((container: Container) => F);

Defined in: src/wirestate-lit/consumption/use-injection.ts:19

A fallback for an optional injection: a raw value or a (container) => value factory, used only when the token is not bound.

Type Parameters

Type Parameter
F

Remarks

A bare function is always treated as the factory - to fall back to a function value, return it from the factory (() => fn).