refactor: create a global events object with emittery
This commit is contained in:
parent
1898a50e3f
commit
7e60bea57c
|
@ -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;
|
||||||
|
|
Reference in New Issue