Module
Web.Worker.Worker
- Package
- purescript-web-workers
- Repository
- purescript-web/purescript-web-workers
This module contains function to create and control workers from the parent's worker
#new Source
new :: String -> WorkerOptions -> Effect Workercreates a worker object that executes the script at the specified URL.
#onMessageError Source
onMessageError :: (MessageEvent -> Effect Unit) -> Worker -> Effect Unitfired when the worker's parent receives a message that can't be deserialized.
#postMessage Source
postMessage :: forall msg. IsSendable msg => msg -> Worker -> Effect Unitsends a message to the worker's inner scope.
#postMessage' Source
postMessage' :: forall msg. IsSendable msg => msg -> Array Transferable -> Worker -> Effect Unit#toEventTarget Source
toEventTarget :: Worker -> EventTargetRe-exports from Web.Worker.Options
#WorkerOptions Source
type WorkerOptions = { name :: String, type :: WorkerType }