Chore: Type improvements 🧹 (#75271)

* fix some e2e flows types

* some type fixes

* must... fix... more...

* MOAR

* MOREMOREMORE

* 1 more
This commit is contained in:
Ashley Harrison
2023-09-22 15:06:49 +01:00
committed by GitHub
parent eba74f0408
commit ff0642bf6e
65 changed files with 217 additions and 387 deletions
+4 -4
View File
@@ -123,20 +123,20 @@ class ScopedEventBus implements EventBus {
publish<T extends BusEvent>(event: T): void {
if (!event.origin) {
(event as any).origin = this;
event.origin = this;
}
this.eventBus.publish(event);
}
filter = (event: BusEvent) => {
filter<T extends BusEvent>(event: T) {
if (this.filterConfig.onlyLocal) {
return event.origin === this;
}
return true;
};
}
getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T> {
return this.eventBus.getStream(eventType).pipe(filter(this.filter)) as Observable<T>;
return this.eventBus.getStream(eventType).pipe(filter(this.filter));
}
// syntax sugar
+1 -1
View File
@@ -7,7 +7,7 @@ import { Unsubscribable, Observable } from 'rxjs';
export interface BusEvent {
readonly type: string;
readonly payload?: any;
readonly origin?: EventBus;
origin?: EventBus;
}
/**