Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Promises. Answers. Succession and order

So I have to work with Qlik Sense Mashups and it requires pretty much work with Async Calls and answers from the Server. I've sent some requests to the server for some filtering and, if the filtering was successful the server answers your requests.

I've done some initial filtering and asked the server for some kpi's on page load and ended up by creating a Promise.all() so that I wait until all Calls receive an answer.

But now I have this clickable filter dropdown and it has to apply filters on click and show the applied filters in another dropdown and I have thought it should work like this:

  1. First I have to send the filter to the server(on Click Event handler)
  2. Wait for the answer from the server that the filter was successfully applied on the back-end values.
  3. Ask the server for the currently applied filters.
  4. Wait for the answer with the currently applied filters, show them as DOM elements.
  5. Theoretically the active filters should be displayed as soon as possible on the DOM.

Any Ideas how can I somehow stack those operations to make them execute as explained in that order.

Many thanks! :)

Comments