Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

setPromise method

Applies to Windows and Windows Phone

Informs the application object that asynchronous work is being performed, and that this event handler should not be considered complete until the promise completes. This function can be set inside the handlers for all WinJS.Application events:

Syntax


eventInfo.detail.setPromise(promise);

Parameters

promise

Type: WinJS.Promise

The promise that should complete before processing is complete.

Return value

This method does not return a value.

Examples

The following code shows how to use this function inside an event handler.


app.onready = function (eventInfo) {
    eventInfo.detail.setPromise(
       WinJS.Application.roaming.writeText("dataFile.txt", "ready at: " + new Date())
    );
};


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.Application

Library

Winjs.js

 

 

Show:
© 2015 Microsoft