Skip to content

createFragmentAsync

Creates a DocumentFragment asynchronously.

Import:

import { createFragmentAsync } from 'obsidian-dev-utils/html-element';

Signature:

function createFragmentAsync(callback: ((el: DocumentFragment) => Promisable<void>) | undefined): Promise<DocumentFragment>

Parameters:

ParameterTypeDescription
callback((el: DocumentFragment) => Promisable<void>) | undefinedThe callback to call when the DocumentFragment is created.

Returns: Promise<DocumentFragment> — A Promise that resolves to the DocumentFragment.