Skip to content

Type Alias: DisposablePlayUI

API / @xmachines/play-dom / DisposablePlayUI

type DisposablePlayUI = (...args) => Cleanup;

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

The mount function that createPlayUI builds.

It IS a MountFn, and it says one thing more: the mount hands back a Cleanup, so a caller may release it with using and write no teardown.

const mount = createPlayUI(registryResult);
{
using stop = mount(actor, container);
// stop() runs at the end of the scope, and after an exception too
}

A narrowed return and not a narrowed MountFn: the return type of a function may narrow, so this costs a consumer that writes a MountFn nothing. The parameters come from MountFn through Parameters, so the two signatures cannot drift.

Parameters

ParameterType
…argsParameters<MountFn>

Returns

Cleanup