import { UmbContextToken } from '../token/context-token'; import { UmbContextConsumer } from './context-consumer'; import { UmbContextCallback } from './context-request.event'; import type { UmbControllerHostInterface, UmbControllerInterface } from '@umbraco-cms/backoffice/controller'; export class UmbContextConsumerController extends UmbContextConsumer implements UmbControllerInterface { public get unique() { return undefined; } constructor( host: UmbControllerHostInterface, contextAlias: string | UmbContextToken, callback: UmbContextCallback ) { super(host, contextAlias, callback); host.addController(this); } public destroy() { super.destroy(); if (this.host) { this.host.removeController(this); } } }