convertSyncToAsync<Arguments, Result>
Converts a synchronous function to an asynchronous one by wrapping it in a Promise.
Import:
import { convertSyncToAsync } from 'obsidian-dev-utils/async';Signature:
function convertSyncToAsync(syncFunction: GenericFunction<Arguments, Result>): GenericAsyncFunction<Arguments, Result>Parameters:
| Parameter | Type | Description |
|---|---|---|
syncFunction | GenericFunction<Arguments, Result> | The synchronous function to convert. |
Returns: GenericAsyncFunction<Arguments, Result> — A function that wraps the synchronous function in an asynchronous interface.