@yorkie-js/sdk
    Preparing search index...

    Class WebLocksSessionLock

    WebLocksSessionLock is the default SessionLock, backed by the Web Locks API (navigator.locks.request with { ifAvailable: true }).

    A Web Lock is held for as long as the promise returned from the request's callback stays pending. To hold the lock for the whole attachment lifetime, acquire keeps that callback pending on a promise that only resolves when the returned handle's release is called. When the lock is already held (another tab), ifAvailable invokes the callback with a null lock and acquire resolves undefined — the fail-fast signal.

    When the Web Locks API is unavailable (non-browser runtimes), this is a no-op: acquire always resolves a handle whose release does nothing, so it never breaks non-browser usage. Multi-tab safety simply does not apply there.

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods