brows3r — TypeScript API
    Preparing search index...

    Function useLocks

    • React hook that returns lock state for a given resource scope.

      Parameters

      • scope: string

        The resource scope string, e.g. "p-1/my-bucket/photos/".

        Returns:

        • locks — active lock records intersecting the scope.
        • isLockedtrue when any lock intersects.
        • blockedActions — command ids that must be disabled due to active locks.

        Implementation note: we subscribe to the raw locks array and filter in the selector so that Zustand can determine reference equality. Calling s.byScope(scope) from the selector would create a new array on every render even when the locks array hasn't changed, causing infinite re-renders.

      Returns { blockedActions: string[]; isLocked: boolean; locks: ResourceLock[] }