Create Libraries and basic tooltip
This commit is contained in:
1
libs/_internal/controllers/src/index.ts
Normal file
1
libs/_internal/controllers/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './lib/destroy.controller';
|
||||
28
libs/_internal/controllers/src/lib/destroy.controller.ts
Normal file
28
libs/_internal/controllers/src/lib/destroy.controller.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export class DestroyController implements ReactiveController {
|
||||
/** Private variables */
|
||||
private readonly _host: ReactiveControllerHost;
|
||||
private readonly destroy$ = new Subject<void>();
|
||||
|
||||
/** Protected variables */
|
||||
|
||||
/** Public variables */
|
||||
public readonly destroy = this.destroy$.asObservable();
|
||||
|
||||
/** constructor & lifecylce */
|
||||
constructor(host: ReactiveControllerHost) {
|
||||
(this._host = host).addController(this);
|
||||
}
|
||||
|
||||
/** Public methods */
|
||||
public hostDisconnected() {
|
||||
this.destroy$.next();
|
||||
this.destroy$.complete();
|
||||
}
|
||||
|
||||
/** Protected methods */
|
||||
|
||||
/** Private methods */
|
||||
}
|
||||
Reference in New Issue
Block a user