Windows Dev Center

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 supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Promise

Library

Winjs.js

See also

Promise

 

 

Show:
© 2015 Microsoft