Skip to main content

LensStudio:GeneralUtils.js.promisify

Function

Converts a callback-based function to a Promise-based function.

promisify<T>(fn): Promise<T>

Converts a callback-based function to a Promise-based function.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
fn(callback) => voidThe callback-based function to convert.

Returns

Promise<T>

A Promise-based version of the function.