Nativescript: In NS 3.x is Javascript async/await supported

Created on 18 Sep 2017  路  3Comments  路  Source: NativeScript/NativeScript

In NS 3.x is Javascript async/await supported - used to work in NS 2.x.

In code, I've got something like:

private async onTapBounce( ) { //await my_func(); }
Looking at the JS code

ToyModel.prototype._onTapBounce = function (label) { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); };

I'm getting undefined ____awaiter at runtime.

question

Most helpful comment

Hi @erjdriver,
Thank you for contacting us.

About your request, I make a little research and found that async/await should be supported in NativeScript. For further help and more info how to use it, you could review the article here.

Another option to be able to use async/await is to open your project tsconfig.json file and to set noEmitHelpers to false.

Hope this helps.

All 3 comments

Hi @erjdriver,
Thank you for contacting us.

About your request, I make a little research and found that async/await should be supported in NativeScript. For further help and more info how to use it, you could review the article here.

Another option to be able to use async/await is to open your project tsconfig.json file and to set noEmitHelpers to false.

Hope this helps.

Thank you - it does.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yclau picture yclau  路  3Comments

vtisnado picture vtisnado  路  3Comments

valentinstoychev picture valentinstoychev  路  3Comments

NickIliev picture NickIliev  路  3Comments

Leo-lay picture Leo-lay  路  3Comments