Create Libraries and basic tooltip

This commit is contained in:
2023-08-25 22:09:18 +02:00
parent 82561d8dc7
commit 14c1b97622
81 changed files with 9117 additions and 2036 deletions

View File

@@ -0,0 +1 @@
export { asyncDirective } from './lib/async-directive';

View File

@@ -0,0 +1,28 @@
import { noChange } from 'lit';
import { AsyncDirective, directive } from 'lit/async-directive.js';
import { Observable, Subject, tap } from 'rxjs';
class Async extends AsyncDirective {
private readonly destroy$ = new Subject<void>();
render(observable: Observable<unknown>) {
observable
.pipe(
tap((value: unknown) => {
this.setValue(value);
}),
)
.subscribe();
return noChange;
}
protected override disconnected(): void {
super.disconnected();
this.destroy$.next();
this.destroy$.complete();
}
}
export const asyncDirective = directive(Async);