jsaddle-wasm-0.1.2.1: Run JSaddle JSM with the GHC Wasm backend
Safe HaskellNone
LanguageGHC2021

Language.Javascript.JSaddle.Wasm

Contents

Description

See the README for more details.

While this package also compiles on non-Wasm GHCs for convenience, running any function from this module will immediately fail in that case.

Synopsis

Documentation

run :: JSM () -> IO () Source #

Run a JSM action via the Wasm JavaScript FFI.

runWorker :: JSM () -> JSVal -> IO () Source #

Run the "worker part" of a JSM action, interacting with the JSaddle JS code via the given JSVal, a message port like e.g. a web worker.

The messages at the connected message port must be dispatched using jsaddleScript.

Re-exports

jsaddleScript :: ByteString #

A chunk of JavaScript that defines a function runJSaddle, a function that takes a message port (e.g. a web worker) as its single argument, and then processes incoming JSaddle commands.