Async version of withGroup(); automatically manages group lifecycle around async operations.
The promise return type of the wrapped function.
The group label for this operation.
The async function to wrap.
If true, creates a collapsed group (default: true).
Promise resolving to the return value of the wrapped function.
Rethrows any error or rejection from the wrapped function.
export async function withGroupAsync<T>( label: string, fn: () => Promise<T>, collapsed = true,): Promise<T> { startGroup(label, collapsed); try { return await fn(); } finally { endGroup(); }} Copy
export async function withGroupAsync<T>( label: string, fn: () => Promise<T>, collapsed = true,): Promise<T> { startGroup(label, collapsed); try { return await fn(); } finally { endGroup(); }}
Async version of withGroup(); automatically manages group lifecycle around async operations.