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 |
|
See also
Build date: 12/5/2012