Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/samualtnorman/lib. A collection of common utilities I need. www.npmjs.com/package/@samual/lib
Something went wrong. Try again.
1234567891011import { isMainThread } from "worker_threads"
// /** @example// * const { heavyFunction } = importInWorker<typeof import("./heavyFunction.js"), "heavyFunction">(// * new URL("./heavyFunction.js", import.meta.url),// * "heavyFunction"// * ) */// export const importInWorker = (await (isMainThread ? import(`./fromMainThread`) : import(`./fromWorker`))).importInWorker
export {}