Module Worker.Shared

Shared workers.

type t

The type for SharedWorker objects.

val create : ?⁠opts:opts -> Jstr.t -> t

create ~opts uri creates a shared worker that executes the script uri. This may throw a Jv.Error exception.

val as_target : t -> Brr.Ev.target

as_target w is w as an event target.

val port : t -> Brr_io.Message.Port.t

port w is the port of w.