CreatePromiseRace (open)

The race function returns a new promise which is settled in the same way as the first passed promise to settle.

Syntax

LOADLIB "wh::promise.whlib";

OBJECT FUNCTION CreatePromiseRace(OBJECT ARRAY promises, RECORD options)

Parameters

OBJECT ARRAY promises

List of promises

RECORD options

Options

wrap

If TRUE, wrap resolved promises values in a record [ source := resolved promise, value := resolved value ]

Return value

OBJECT

New promise.