Skip to content

Commit

Permalink
worker module docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davay42 committed Apr 27, 2023
1 parent c167c6c commit e5c7344
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gun/useGunWorker.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/**
* Gun DB to be used as an inlined Web Worker
* @module GunWorker
* @group Database
*/


//@ts-ignore
import worker from './worker.js?worker&inline'
import { useWebWorker } from '@vueuse/core'
import { watch } from 'vue'

const GunWorker = useWebWorker(worker)

GunWorker.post('Worker check up')
GunWorker.post('Worker post check up')

watch(GunWorker.data, d => console.log('Recieved:', d), { immediate: true })

Expand Down

0 comments on commit e5c7344

Please sign in to comment.