From the reference libraryRedM

Promise <BadgeShared/>

jo_libs/modules/promise/shared.md

Promise <BadgeShared/>

Promise is a module to transform callback-style functions into Promise-based operations, allowing for more elegant handling of asynchronous code.

JO Functions > jo.promise.new()

<!-- @include: ./slots/headers.md#shared|jo.promise.new -->

Creates a new Promise that wraps a callback function <br> This utility transforms callback-style functions into Promise-returning functions <br>

<!-- @include: ./slots/descriptions.md#shared|jo.promise.new -->

JO Functions > jo.promise.new() > Syntax

jo.promise.new(cb, ...)

JO Functions > jo.promise.new() > Parameters

cb : function

The callback function to be wrapped in a Promise

... : mixed

Arguments to pass to the callback function

JO Functions > jo.promise.new() > Return Value

Type : ...

The resolved values from the Promise

<!-- @include: ./slots/examples.md#shared|jo.promise.new -->

<!-- @include: ./slots/footers.md#shared|jo.promise.new -->

Back to documentation