Skip to content

Class: DevToolsPlugin ​

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:61

Read-only observer plugin that exposes a container subtree to an inspector backend (a Chrome extension or a standalone dev panel).

Example ​

typescript
import { Container, type WirestatePlugin } from "@wirestate/core";
import { DevToolsPlugin } from "@wirestate/core/devtools";

const plugins: Array<WirestatePlugin> = process.env.NODE_ENV === "production" ? [] : [new DevToolsPlugin()];

new Container({ plugins });

Implements ​

Constructors ​

Constructor ​

ts
new DevToolsPlugin(options?: DevToolsPluginOptions): DevToolsPlugin;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:110

Parameters ​

ParameterTypeDescription
options?DevToolsPluginOptionsOptional plugin options (see DevToolsPluginOptions).

Returns ​

DevToolsPlugin

Methods ​

install() ​

ts
install(): void;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:114

Contributes bindings (or other one-time setup) when the plugin is registered.

Returns ​

void

Remarks ​

Runs once, on the container the plugin is registered on (not on inheriting children), before any binding activates.

Register cleanup for install-time side effects with addRollback. Rollbacks run in reverse order if this or a later install throws, or if container construction fails afterwards. They are failsafe and do not run during normal container teardown.

Implementation of ​

WirestatePlugin.install


onActivate() ​

ts
onActivate(instance: object, container: Container): void;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:173

Runs after a service instance is activated, before its @OnActivation.

Parameters ​

ParameterTypeDescription
instanceobjectThe activated instance.
containerContainerContainer that activated it.

Returns ​

void

Implementation of ​

WirestatePlugin.onActivate


onContainerDeprovision() ​

ts
onContainerDeprovision(container: Container): void;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:128

Runs once at the end of a container deprovision cycle, after all teardown.

Parameters ​

ParameterTypeDescription
containerContainerContainer being deprovisioned.

Returns ​

void

Implementation of ​

WirestatePlugin.onContainerDeprovision


onContainerProvision() ​

ts
onContainerProvision(container: Container): void;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:121

Runs once at the start of a container provision cycle, before instance wiring.

Parameters ​

ParameterTypeDescription
containerContainerContainer being provisioned.

Returns ​

void

Implementation of ​

WirestatePlugin.onContainerProvision


onDeactivate() ​

ts
onDeactivate(instance: object, container: Container): void;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:177

Runs as a service instance is deactivated, after its @OnDeactivation.

Parameters ​

ParameterTypeDescription
instanceobjectThe instance being deactivated.
containerContainerContainer that owns it.

Returns ​

void

Implementation of ​

WirestatePlugin.onDeactivate


onDeprovision() ​

ts
onDeprovision(instance: object, container: Container): void;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:185

Runs as a provisioned instance is deprovisioned, after its @OnDeprovision.

Parameters ​

ParameterTypeDescription
instanceobjectThe instance being deprovisioned.
containerContainerContainer that owns it.

Returns ​

void

Implementation of ​

WirestatePlugin.onDeprovision


onProvision() ​

ts
onProvision(instance: object, container: Container): void;

Defined in: src/wirestate-core/plugin/devtools/devtools-plugin.ts:181

Wires a provisioned instance, before any user @OnProvision.

Parameters ​

ParameterTypeDescription
instanceobjectThe provisioned instance.
containerContainerContainer being provisioned.

Returns ​

void

Remarks ​

Register teardown with addDisposer. Disposers run (reverse order, failsafe) at deprovision. A throw here unwinds the whole provision cycle.

Implementation of ​

WirestatePlugin.onProvision