Skip to content

chain

Chains a promise with another promise.

Import:

import { chain } from 'obsidian-dev-utils/async';

Signature:

function chain(chainPromise: Promise<void> | null, promisableFn: () => Promisable<void> | null): Promise<void> | null

Parameters:

ParameterTypeDescription
chainPromisePromise<void> | nullRepresents the chained promise.
promisableFn() => Promisable<void> | nullThe function to chain.

Returns: Promise<void> | null — Chained promise or null if no async logic is chained.