ui-router-devtools / lazy / LazyDevtoolsPlugin
Class: LazyDevtoolsPlugin
Defined in: ui-router-devtools/src/lazy.ts:41
Records the router from registration; mount(target) loads <ui-router-devtools>, hands it the recorder and appends it to target, and unmount() removes it while the recorder keeps running. Only the recorder loads with the plugin: lit, d3 and the element load on the first mount().
Example
import { UIRouter } from '@uirouter/core';
import { LazyDevtoolsPlugin } from 'ui-router-devtools/lazy';
declare const router: UIRouter;
// Before the router starts, so the first transition is recorded.
const devtools = router.plugin(LazyDevtoolsPlugin, { timeResolves: true });
// Later, from a key binding or a button: the panel shows every transition since registration.
await devtools.mount(document.body);Implements
Constructors
Constructor
new LazyDevtoolsPlugin(router, options?): LazyDevtoolsPlugin;Defined in: ui-router-devtools/src/lazy.ts:53
Parameters
| Parameter | Type |
|---|---|
router | UIRouter |
options? | LazyDevtoolsPluginOptions |
Returns
LazyDevtoolsPlugin
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | public | string | 'devtools' | The plugin's name in the router's plugin registry, shared with DevtoolsPlugin. | ui-router-devtools/src/lazy.ts:43 |
recorder | readonly | Recorder | undefined | The recorder the plugin started; the panel follows it, and reporters can share it. | ui-router-devtools/src/lazy.ts:45 |
Accessors
element
Get Signature
get element():
| UIRouterDevtools
| undefined;Defined in: ui-router-devtools/src/lazy.ts:62
The <ui-router-devtools> in the DOM while the plugin is mounted.
Returns
| UIRouterDevtools | undefined
Methods
dispose()
dispose(): void;Defined in: ui-router-devtools/src/lazy.ts:128
Stops the recorder and unmounts the element.
Returns
void
Implementation of
UIRouterPlugin.dispose
mount()
mount(target): Promise<void>;Defined in: ui-router-devtools/src/lazy.ts:72
Loads <ui-router-devtools>, hands it the recorder and appends it to target; the panel shows everything recorded since registration. Resolves once the element is in the DOM, or without appending it when unmount() or dispose() comes first. Rejects while the plugin is mounted or mounting, once it is disposed, and when loading or appending fails, which leaves it unmounted.
Parameters
| Parameter | Type |
|---|---|
target | Element |
Returns
Promise<void>
unmount()
unmount(): void;Defined in: ui-router-devtools/src/lazy.ts:98
Removes the element and keeps the recorder running, so the next mount() replays it; cancels a mount() still loading.
Returns
void