Add PowWorker to mine Nostr events off the main thread

This commit is contained in:
Alex Gleason
2023-11-20 15:38:05 -06:00
parent f7aff70185
commit d293c9d900
4 changed files with 25 additions and 0 deletions

9
src/workers.ts Normal file
View File

@ -0,0 +1,9 @@
import * as Comlink from 'comlink';
import type { PowWorker } from './workers/pow.worker';
const powWorker = Comlink.wrap<typeof PowWorker>(
new Worker(new URL('./workers/pow.worker.ts', import.meta.url), { type: 'module' }),
);
export { powWorker };