Skip to content

LoopParams<T>

Options for loop.

Import:

import type { LoopParams } from '@mnaoumov/obsidian-lib/loop';

Signature:

export interface LoopParams<T>

Properties

PropertyTypeDescription
abortSignal?AbortSignalAn optional abort signal to cancel the loop.
buildNoticeMessage(params: LoopBuildNoticeMessageParams<T>) => stringBuild a notice message for each item.
itemsT[]Items to loop over.
noticeBeforeShownTimeoutInMilliseconds?numberA timeout for the notice before it is shown.
noticeMinTimeoutInMilliseconds?numberA minimum timeout for the notice.
pluginNoticeComponentnull | PluginNoticeComponentA component to show notices.
processItem(item: T) => Promisable<void>Process each item.
progressBarTitle?DocumentFragment | stringA title of the progress bar.

Pass a DocumentFragment to mark up part of the title, such as a plugin name rendered as code. Each render appends a fresh clone of it, so the caller's fragment stays intact.
shouldContinueOnError?booleanWhether to continue the loop on error.
shouldShowNotice?booleanWhether to show a notice.
shouldShowProgressBar?booleanWhether to show a progress bar.
uiUpdateThresholdInMilliseconds?numberA threshold for the UI update.

Links to this page: