wrap function

WinJS.Promise.wrap function

Applies to Windows and Windows Phone

Wraps a non-promise value in a promise. This method is like wrapError, which allows you to produce a Promise in error conditions, in that it allows you to return a Promise in success conditions.

Syntax


var promise = WinJS.Promise.wrap(nonPromise);

Parameters

value

Type: object

Some non-promise value to be wrapped in a promise.

Return value

Type: Promise

A promise that is successfully fulfilled with the specified value.

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.Promise

See also

Promise

 

 

Show:
© 2017 Microsoft