Questions tagged [winjs-promise]

Provides a mechanism to schedule work to be done on a value that has not yet been computed. It is an abstraction for managing interactions with asynchronous APIs.

Every javascript framework has its own promises implementation. These are the one from WinJS. http://msdn.microsoft.com/en-us/library/windows/apps/br211867.aspx

8 questions
2
votes
1 answer

Lightswitch html how to know when async iteration is done

I have an async operation inside another async operation. I wonder how can i know when everything is done. Here is my code: msls.showProgress(msls.promiseOperation(function (operation) { screen.Staff.getConfirmedWaiters().then(function…
Lerner
  • 1,111
  • 13
  • 19
2
votes
3 answers

Failing promise gets catched by the Application.onerror function

There's this weird behavior which I don't know if it is supposed to be happening or it's a winjs bug. I'm using the WinJS.UI.Pages.render to render the content of a page under a specific element. The problem I'm facing is that no matter if I handle…
sebagomez
  • 9,501
  • 7
  • 51
  • 89
0
votes
1 answer

How to execute a variable-sized array of promises in Javascript

I'm working on a piece of code to request information from an API. Throttles at 10 requests per second. My solution was to Promise.all(calculate(item1),calculate(item2)... ) and so forth for the 10 requests. My approach was questionable to say the…
Max
  • 3
  • 6
0
votes
0 answers

Node Js function returning undifined variable

My function: async function GetItemStats(item_id) { var jsonResponse; const url = "someUrl"; const data = { data: item_id }; const options = { method: "POST", headers: { "Content-Type": "application/json", Cookie: …
0
votes
1 answer

WinJS : Returning promise from a function

I would like to make a function that returns a promise. That promise would contain the data of an asynchronous call made in the function. What I want it to look like : //Function that do asynchronous work function f1() { var url = ... …
Speccy
  • 694
  • 8
  • 30
0
votes
4 answers

Getting lightswitch HTML client to load related entities

I am trying to load an entity based on a Query and allow the user to edit it. The entity loads without issues from the query, however it does not load its related entities, leaving detail pickers unfilled when loading the edit screen. This is the…
Yishai
  • 90,445
  • 31
  • 189
  • 263
0
votes
1 answer

Why does one method of stacking promises in Lightswitch work when another doesn't?

I'm working with a Lightswitch 2015 application for tracking customer satisfaction interviews. I'm trying to create a function that will create a new interview, populate a few items, then save it to the database, and open it for editing in a new…
0
votes
1 answer

Access Denied when using WinJS promise

I am trying to get dial device from an ID, but when I use .done() or .then() on .fromIdAsync() as given in the api DialDevice.FromIdAsync | fromIdAsync method. I am getting access denied error and app is getting closed What wrong am I doing?
RecklessSergio
  • 806
  • 3
  • 10
  • 34