Skip to content

Interface: LifecycleDecorator()<Method> ​

Defined in: src/wirestate-core/metadata/metadata-single-method-decorator.ts:21

Method decorator returned by the single-method lifecycle hooks: @OnActivation, @OnDeactivation, @OnProvision, and @OnDeprovision.

Remarks ​

The decorated method must accept the arguments its phase delivers and nothing more, so a hook declaring a parameter the runtime never passes is rejected at compile time. Activation hooks receive no arguments. Provision hooks may declare the ProvisionId of the cycle.

Type Parameters ​

Type ParameterDefault typeDescription
Method extends (...args: never[]) => unknown() => unknownSignature the decorated method must be assignable to.

Call Signature ​

ts
LifecycleDecorator<This>(value: (this: This, ...args: Parameters<Method>) => unknown, context: ClassMethodDecoratorContext<This>): void;

Defined in: src/wirestate-core/metadata/metadata-single-method-decorator.ts:23

Method decorator returned by the single-method lifecycle hooks: @OnActivation, @OnDeactivation, @OnProvision, and @OnDeprovision.

Type Parameters ​

Type Parameter
This

Parameters ​

ParameterType
value(this: This, ...args: Parameters<Method>) => unknown
contextClassMethodDecoratorContext<This>

Returns ​

void

Remarks ​

The decorated method must accept the arguments its phase delivers and nothing more, so a hook declaring a parameter the runtime never passes is rejected at compile time. Activation hooks receive no arguments. Provision hooks may declare the ProvisionId of the cycle.

Call Signature ​

ts
LifecycleDecorator<Actual>(
   target: object, 
   propertyKey: string | symbol, 
   descriptor: TypedPropertyDescriptor<Actual>): void;

Defined in: src/wirestate-core/metadata/metadata-single-method-decorator.ts:26

Method decorator returned by the single-method lifecycle hooks: @OnActivation, @OnDeactivation, @OnProvision, and @OnDeprovision.

Type Parameters ​

Type Parameter
Actual extends (...args: never[]) => unknown

Parameters ​

ParameterType
targetobject
propertyKeystring | symbol
descriptorTypedPropertyDescriptor<Actual>

Returns ​

void

Remarks ​

The decorated method must accept the arguments its phase delivers and nothing more, so a hook declaring a parameter the runtime never passes is rejected at compile time. Activation hooks receive no arguments. Provision hooks may declare the ProvisionId of the cycle.