interface ILoadedPlugin<T> {
    isEnabled: (() => boolean);
    plugin: T;
    remove: ((isAsync?: boolean, removeCb?: ((removed?: boolean) => void)) => void);
    setEnabled: ((isEnabled: boolean) => void);
}

Type Parameters

Properties

isEnabled: (() => boolean)

Identifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..

Type declaration

    • (): boolean
    • Returns boolean

      boolean = true if the plugin is in a state where it is operational.

plugin: T
remove: ((isAsync?: boolean, removeCb?: ((removed?: boolean) => void)) => void)
setEnabled: ((isEnabled: boolean) => void)

You can optionally enable / disable a plugin from processing events. Setting enabled to true will not necessarily cause the isEnabled() to also return true as the plugin must also have been successfully initialized and not had it's teardown method called (unless it's also been re-initialized)