Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 2x 3x 3x 3x 3x | import merge from 'lodash/merge';
import { IllusionEngine } from './illusion-engine';
import { Options, defaultOptions } from './options';
import { Servicer } from './servicer/servicer';
const offscreenCanvasSupported = !!window.OffscreenCanvas;
export async function installIllusionEngine(options?: Options): Promise<IllusionEngine> {
options = merge({}, defaultOptions, options);
options.useWorker = offscreenCanvasSupported && options.useWorker;
const importPromise: Promise<new () => Servicer> = options.useWorker ?
import(/* webpackChunkName: "IllusionWorkerServicer" */ './servicer/worker-servicer').then(({ WorkerServicer }) => WorkerServicer):
import(/* webpackChunkName: "IllusionNornalServicer" */ './servicer/normal-servicer').then(({NormalServicer}) => NormalServicer)
return importPromise.then(Servicer => {
return new IllusionEngine(new Servicer(), options!);
});
}
|