[#301] How to make asynchronous javascript calls?

Migrated from Redmine #301 | Author: Tavan Eftekhar
Status: New | Priority: High, I’m very impatient | Created: 2018-12-09


After connecting to the client, and calling something like:

var unitList = this.client.getUnitList();

It takes a couple seconds and is blocking, the code following that line must wait for the call to return before proceeding. I would like to avoid that and use a success callback instead. Is there a simple way to wrap these calls so they operates asynchronously? Like with an onsuccess, onerror function?

Any help would be greatly appreciated!

Dmytro Bondarev wrote:

Hi! If you use client library from example, then pass last parameter as callback. In this case it will work asynchronously.
this.client.getUnitList(function (result) {
console.log(result);
});

Tavan Eftekhar wrote:

Dmitry Bondarev wrote:

Hi! If you use client library from example, then pass last parameter as callback. In this case it will work asynchronously.
this.client.getUnitList(function (result) {
console.log(result);
});

Thank you, that helped!

One more quick question, where is the most up to date information about the API? is it API - Help with API, or is it API documentation | SimplyBook.me Online Scheduling?

I see some conflicts between the two so I’m just curious. Or if there is another method to see all of the available functions that would be great. Thank you!