MCPcopy Create free account
hub / github.com/galacean/engine / init

Function init

packages/loader/src/ktx2/transcoder/BinomialLLCWorkerCode.ts:7–22  ·  view source on GitHub ↗
(wasmBinary?)

Source from the content-addressed store, hash-verified

5 let initPromise: any;
6
7 const init = function (wasmBinary?) {
8 if (!initPromise) {
9 initPromise = new Promise((resolve, reject) => {
10 const BasisModule = {
11 wasmBinary,
12 onRuntimeInitialized: () => resolve(BasisModule),
13 onAbort: reject
14 };
15 self["BASIS"](BasisModule);
16 }).then((BasisModule: any) => {
17 BasisModule.initializeBasis();
18 return BasisModule.KTX2File;
19 });
20 }
21 return initPromise;
22 };
23
24 self.onmessage = function onmessage(event: MessageEvent<IBinomialMessage>) {
25 const message = event.data;

Callers 3

transcodeMethod · 0.90
TranscodeWorkerCodeFunction · 0.70

Calls 1

thenMethod · 0.80

Tested by

no test coverage detected