Promise.wrap method

4 out of 8 rated this helpful - Rate this topic

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


promise.wrap(value).done( /* Your success and error handlers */ );

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.

Remarks


WinJS.Promise.wrap(nonPromise);

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

WinJS

Library

Base.js

See also

Promise

 

 

Build date: 12/5/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.