Skip to content

createFragmentAsync

Creates a DocumentFragment asynchronously.

Import:

import { createFragmentAsync } from '@mnaoumov/typescript-lib/html-element';

Signature:

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

Parameters:

Parameter Type Description
callback ((element: DocumentFragment) => Promisable<void>) | undefined The callback to call when the DocumentFragment is created.

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