Skip to content

Type Alias: MountFn

API / @xmachines/play-dom / MountFn

type MountFn = (actor, container, options?) => () => void;

Defined in: packages/play-dom/src/create-play-ui.ts:78

The mount function that createPlayUI returns.

Call it with (actor, container, mountOptions?) to start the renderer. It returns a disconnect cleanup function. That function stops the render and clears the container.

The return is a plain function here, because a consumer WRITES a value of this type to wrap or to stand in for a mount. A Cleanup return would refuse every such function that hands a plain release back. DisposablePlayUI narrows it for the value that createPlayUI builds, which nothing writes by hand.

Parameters

ParameterType
actorAbstractActor<AnyActorLogic> & Viewable
containerHTMLElement
options?MountOptions

Returns

() => void