Module / v1.0.0-beta.13

@typed/ui/Collection

8 unique exports available through this public import path, including their members and aliases.

Learn this UI primitive →

import * as Collection from "@typed/ui/Collection";

Collection ordering

  • byDomOrder

    function

    Returns a sorted copy using compareDocumentPosition; items without comparable mounted elements retain an equivalent ordering position.

  • enabledItems

    function

    Returns a new array excluding only items whose disabled flag is exactly true.

Collection state

  • State

    type-alias

    Complete renderer-independent state for Collection.

  • makeState

    function

    Creates hydrated Collection state. The collection starts with the supplied immutable item array, or empty.

Item metadata

  • Item

    interface

    Public Collection.Item behavioral model.

Item registration

  • ref

    function

    Registers a mounted element and removes it automatically with the Scope in which the returned Effect is run.

  • register

    function

    Upserts an item immediately and installs a finalizer in the Scope that runs this Effect; the finalizer removes only that exact registration.

  • unregister

    function

    Removes every registered item with the supplied id and retains the remaining order.