CCC Docs
    Preparing search index...

    Class OwnerUnique<T>

    An Owner with a single, transferable ownership claim.

    const owner = new OwnerUnique(
    new AbortController(),
    (controller) => controller.abort(),
    );

    const signal = owner.value.signal;
    await owner.dispose();

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index
    value_: T
    • get value(): T

      The owned value.

      Returns T

      If this ownership has been moved or disposed.

    • Returns whether a value implements CCC Owner semantics.

      Parameters

      • value: unknown

      Returns value is Owner<unknown>

    • Maps the owned value while transferring this ownership claim.

      The mapper runs before the claim is moved, so a mapper failure leaves this Owner active. After a successful mapping, this Owner is invalidated and the returned Owner retains its release semantics.

      Type Parameters

      • U

      Parameters

      • mapper: (value: T) => U

      Returns Owner<U>

    • Moves the ownership claim out of this owner without disposing it.

      Access is invalidated synchronously and the moved claim retains this Owner's release semantics.

      Returns OwnerMoved<T>

      If this owner no longer has an ownership claim.

    • Releases this ownership claim.

      Implementations decide whether this disposes the value immediately or, for example, only decrements a reference count.

      Parameters

      • value: T

      Returns void | PromiseLike<void>