Module

Web.Worker.DedicatedWorkerGlobalScope

Package
purescript-web-workers
Repository
purescript-web/purescript-web-workers

#close Source

close :: Effect Unit

upon calling close, any queued tasks present in the event loop are discarded and the web worker scope is closed.

#onMessage Source

onMessage :: (MessageEvent -> Effect Unit) -> Effect Unit

fired when the worker receives a message from its parent.

#onMessageError Source

onMessageError :: (MessageEvent -> Effect Unit) -> Effect Unit

fired when a worker receives a message that can't be deserialized.

#postMessage Source

postMessage :: forall msg. IsSendable msg => msg -> Effect Unit

sends a message to the main thread that spawned it.

#postMessage' Source

postMessage' :: forall msg. IsSendable msg => msg -> Array Transferable -> Effect Unit

Re-exports from Web.Worker.GlobalScope

#onUnhandledRejection Source

#onRejectionHandled Source

#onLanguageChange Source

#onError Source

onError :: (Event -> Effect Unit) -> Effect Unit

fired when an error occurs in the worker