refactor: create a global events object with emittery

This commit is contained in:
Derrick Hammer 2023-07-20 12:41:46 -04:00
parent 1898a50e3f
commit 7e60bea57c
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import type { KernelAuthStatus } from "@lumeweb/libweb"; import type { KernelAuthStatus } from "@lumeweb/libweb";
import defer, { DeferredPromise } from "p-defer"; import defer, { DeferredPromise } from "p-defer";
import Emittery from "emittery";
let queriesNonce = 1; let queriesNonce = 1;
let queries: any = {}; let queries: any = {};
let portsNonce = 0; let portsNonce = 0;
@ -13,6 +13,7 @@ let authStatusDefer = defer();
let kernelFrame: HTMLIFrameElement; let kernelFrame: HTMLIFrameElement;
let blockForDnsSetup = defer(); let blockForDnsSetup = defer();
let loggedInDefer = defer(); let loggedInDefer = defer();
export const events = new Emittery();
export function getAuthStatusKnown() { export function getAuthStatusKnown() {
return authStatusKnown; return authStatusKnown;