Tab to switch contexts, alt+enter to inject a link

This commit is contained in:
Simon Cambier
2022-06-25 12:01:49 +02:00
parent 887787d303
commit b718f8e5cb
7 changed files with 94 additions and 83 deletions

View File

@@ -34,9 +34,10 @@ export class EventBus {
}
public emit(event: string, ...args: any[]): void {
for (const [key, handler] of this.handlers.entries()) {
const ctx = key.split('@')[0]
if (this.disabled.includes(ctx)) continue
const entries = [...this.handlers.entries()].filter(
([k, h]) => !this.disabled.includes(k.split('@')[0]),
)
for (const [key, handler] of entries) {
if (key.endsWith(`@${event}`)) {
handler(...args)
}