enableAsyncOperationTracking
Enables tracking of fire-and-forget operations scheduled via invokeAsyncSafely (and therefore convertAsyncToSync).
While enabled, each scheduled operation is recorded until it settles so that tests can await them all via waitForAllAsyncOperations, removing the need to override invokeAsyncSafely / convertAsyncToSync in tests.
Tracking is disabled by default, so production code carries no bookkeeping overhead. Intended to be enabled in test environments only.
Import:
import { enableAsyncOperationTracking } from 'obsidian-dev-utils/async';Signature:
function enableAsyncOperationTracking(): DisposableReturns: Disposable — A Disposable that disables tracking again (via disableAsyncOperationTracking) when disposed, for use with using.
Links to this page: