Windows-Apps
Inhaltsverzeichnis reduzieren
Inhaltsverzeichnis erweitern
EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

WinJS.Promise.as function

Applies to Windows and Windows Phone

Returns a promise. If the object is already a Promise it is returned; otherwise the object is wrapped in a Promise.

You can use this function when you need to treat a non-Promise object like a Promise, for example when you are calling a function that expects a promise, but already have the value needed rather than needing to get it asynchronously.

Syntax


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

Parameters

value

Type: Object

The value to be treated as a Promise.

Return value

Type: Promise

The promise.

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.Promise

See also

Promise

 

 

Anzeigen:
© 2016 Microsoft