Skip to content
// EFFECT DAYS 2026

BrowserCase unstable

Mounts a Case in a real document, as the workbench page of DevToolsVite.plugin does.

1 exports Since v4.2.0 Source

Constructors

mount

unstable
Since v4.2.0

Mounts c into container, sends its messages, and returns the root after the DOM commit. The current Scope owns the mount.

Details

The root starts from the case's model when it has one, and the case's layer is built in the current Scope and provided around the mount. Messages are sent in order, as with Play.fromCase. The Effect waits for the following commit, including a held view transition, but not for in-flight Commands.

A full reload starts the case over rather than replaying messages onto a saved Model. In-place hot reload still updates the mounted component.

Signature

declare function mount<C extends AnyComponent, R>(c: Case<C, R> & {
readonly component: HtmlRoot<ElementsOf<C>>;
}, container: Element): Effect<Root<Model<C>, Message<C>, never>, never, Scope | Exclude<R, Host>>