Class: WireStatus
Defined in: src/wirestate-core/activation/wire-status.ts:81
Lifecycle status for one resolved service instance.
Remarks
Wirestate stores one stable WireStatus object per resolved service instance. Container and provider lifecycle internals update that object over time, so application code can keep a reference and read current lifecycle flags without mutating the instance or requiring a base class.
Lifecycle
for()
static for(instance: object, options?: WireStatusLookupOptions): WireStatus;Defined in: src/wirestate-core/activation/wire-status.ts:97
Returns the lifecycle status tracked for a resolved service instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
instance | object | Resolved service instance to inspect. |
options? | WireStatusLookupOptions | Reserved for Wirestate internals. |
Returns
WireStatus
The stable lifecycle status for the instance.
Remarks
Use this inside service methods when async work needs to check whether the service has been deactivated or deprovisioned.
Throws
WirestateError If the object is not tracked by Wirestate.
Properties
isDeactivated
isDeactivated: boolean = false;Defined in: src/wirestate-core/activation/wire-status.ts:117
Whether the instance was deactivated and removed from its container.
isDeprovisioned
isDeprovisioned: Nullable<boolean> = null;Defined in: src/wirestate-core/activation/wire-status.ts:127
Whether the instance has been removed from provider ownership.
Remarks
null means the instance has not reached provider lifecycle yet. false means the instance is currently owned by a provider. true means the provider deprovisioned it.
isInactive
isInactive: boolean;Defined in: src/wirestate-core/activation/wire-status.ts:135
Whether the instance should stop work because its lifecycle ended.
Remarks
This is derived from isDeactivated and isDeprovisioned.
provisionId
provisionId: Nullable<number> = null;Defined in: src/wirestate-core/activation/wire-status.ts:144
Current provider provision cycle ID for the instance.
Remarks
null means the instance has not entered a tracked provider provision cycle.