developit / developit/workerize
Support pass OffscreenCanvas object.
Aperta
- Lingua principale
- JavaScript
- Stelle
- 4.4k
- Fork
- 87
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
```
const worker = workerize(`
export function drawImage(canvas,image){ return canvas.getContext("2d").drawImage(image, 0, 0)}
`)(canvas, image)
worker.drawImage(document.querySelector('canvas'). transferControlToOffscreen(),img)
```
it will throw
```
DOMException: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas could not be cloned because it was not transferred.
```
https://developer.mozilla.org/en-US/docs/Web/API/Transferable
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.