Clean up internal type usages
This commit is contained in:
@@ -1,10 +1,25 @@
|
||||
import { noChange } from 'lit';
|
||||
import { AsyncDirective, directive } from 'lit/async-directive.js';
|
||||
|
||||
import { Observable, Subject, tap } from 'rxjs';
|
||||
|
||||
class Async extends AsyncDirective {
|
||||
/** Private variables */
|
||||
private readonly destroy$ = new Subject<void>();
|
||||
|
||||
/** Protected variables */
|
||||
|
||||
/** Public variables */
|
||||
|
||||
/** constructor & lifecycle */
|
||||
protected override disconnected(): void {
|
||||
super.disconnected();
|
||||
|
||||
this.destroy$.next();
|
||||
this.destroy$.complete();
|
||||
}
|
||||
|
||||
/** Public methods */
|
||||
render(observable: Observable<unknown>) {
|
||||
observable
|
||||
.pipe(
|
||||
@@ -17,12 +32,9 @@ class Async extends AsyncDirective {
|
||||
return noChange;
|
||||
}
|
||||
|
||||
protected override disconnected(): void {
|
||||
super.disconnected();
|
||||
/** Protected methods */
|
||||
|
||||
this.destroy$.next();
|
||||
this.destroy$.complete();
|
||||
}
|
||||
/** Private methods */
|
||||
}
|
||||
|
||||
export const asyncDirective = directive(Async);
|
||||
|
||||
Reference in New Issue
Block a user