Skip to content

requestResourceUnlockForPath

Requests an unlock of the note at the given path by aborting every AbortController that was associated with a lock on it (via ResourceLockComponent.lockForPath’s ResourceLockComponentLockForPathParams.abortController). The operations holding the lock observe the abort and release their own locks. A no-op when no abortable lock is registered for the path.

This lets a consuming plugin wire its own “unlock active note” command without reaching into the lock manager directly.

Import:

import { requestResourceUnlockForPath } from '@mnaoumov/obsidian-lib/resource-lock';

Signature:

function requestResourceUnlockForPath(app: App, pathOrFile: PathOrFile): void

Parameters:

Parameter Type Description
app App The Obsidian app instance.
pathOrFile PathOrFile The path or file of the note to request an unlock for.

Returns: void


Links to this page: