Remove usage of 'null' in favor of 'undefined'

This commit is contained in:
Keavon Chambers
2022-08-25 21:32:27 -07:00
parent 1e74ccb4f8
commit 33cb6fcb00
21 changed files with 45 additions and 323 deletions
+2 -2
View File
@@ -8,12 +8,12 @@ export type WasmEditorInstance = InstanceType<WasmRawInstance["JsEditorHandle"]>
export type Editor = Readonly<ReturnType<typeof createEditor>>;
// `wasmImport` starts uninitialized because its initialization needs to occur asynchronously, and thus needs to occur by manually calling and awaiting `initWasm()`
let wasmImport: WasmRawInstance | null = null;
let wasmImport: WasmRawInstance | undefined;
// Should be called asynchronously before `createEditor()`
export async function initWasm(): Promise<void> {
// Skip if the WASM module is already initialized
if (wasmImport !== null) return;
if (wasmImport !== undefined) return;
// Import the WASM module JS bindings and wrap them in the panic proxy
wasmImport = await import("@/../wasm/pkg").then(panicProxy);