Sanity Library Reference Docs
    Preparing search index...
    • A refcounted id set: acquire/release per mounted consumer, the list of live ids as state. An id stays live while ANY consumer holds it, so several surfaces can independently keep the same id registered without racing each other's teardown — the store-agnostic building block for "a document is watched while any surface reads it" registration. releaseDelayMs keeps an id live for a grace period after its last release; reacquiring it cancels the pending removal.

      Parameters

      • options: { releaseDelayMs?: number } = {}

      Returns {
          acquire: (id: string) => void;
          ids: readonly string[];
          release: (id: string) => void;
      }