Skip to content

Interface: UseOptionalInjectionOptions<T, F>

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

Represents options for useOptionalInjection.

Type Parameters

Type ParameterDefault type
T-
Fnull

Properties

injectionId

ts
injectionId: ServiceIdentifier<T>;

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

The service identifier to inject.


once?

ts
optional once?: boolean;

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

Resolve only the first context value.

Remarks

If true, the service will not update when the container context changes. Defaults to false.


onFallback?

ts
optional onFallback?: OptionalInjectionFallback<F>;

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

Provides a value when the service identifier is not bound.


value?

ts
optional value?: T | F;

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

Initial value before the service is fetched.