Clean up internal type usages

This commit is contained in:
2023-09-02 21:02:50 +02:00
parent 41830bbca5
commit ad59f07d2b
14 changed files with 176 additions and 22 deletions

View File

@@ -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);