ecmascript-2017 Questions

3

Solved

I have a function chain in a node 4.3 script that looks something like, callback -> promise -> async/await -> async/await -> async/await like so: const topLevel = (resolve, reject) => { const...
Yolanthe asked 28/11, 2016 at 16:37

5

Solved

The ECMAScript specification defines the Atomics object in the section 24.4. Among all the global objects this is the more obscure for me since I didn't know about its existence until I didn't rea...
Promethium asked 24/8, 2017 at 21:6

2

Solved

Regarding compatibility between ECMAScript specification and actual implementation; It is fairly easy to check out the data about browser support for ECMAScript2015 (ES6), but I found it pretty dif...
Stellate asked 16/5, 2020 at 11:23

4

Is it or will it be possible to have an ES6 class getter return a value from an ES2017 await / async function. class Foo { async get bar() { var result = await someAsyncOperation(); return res...
Statampere asked 23/11, 2015 at 19:47

2

I have been getting the following error constantly throughout this process SyntaxError: /Users/user1/npmprojects/experiments/test-reactstrap0/src/components/index.js: Support for the experimental ...
Hallvard asked 28/3, 2019 at 15:37

2

Solved

ECMA-2017(ES8), just finalized about a month ago, introduces SharedArrayBuffer and Atomics. The link here shows that they have been supported in some browsers. As we know, they are meant to allow ...

3

Solved

I'm learning react-native, and I'm running into an issue. Why does getting data on return from an async function return a promise, but in the async function itself, it correctly returns an array of...
Rusticate asked 19/7, 2017 at 20:48

1

I'm using karma-typescript, with this karma config file : karmaTypescriptConfig: { compilerOptions: { target: "es5", lib: ["dom", "es2015", "es2017"] }, bundlerOptions: { transforms: [requir...

3

I'm using angular 4 and working on a string pipe to pad string with zeros. But angular or vs-code drops errors that the prototype "padStart" does not exist. How to setup this support to my proje...
Perloff asked 28/10, 2017 at 12:50

1

Solved

I was experimenting with how / is interpreted when around different keywords and operators, and found that the following syntax is perfectly legal: // awaiting something that isn't a Promise i...

5

Solved

My function returns a promise that resolves as soon as the HTTP server starts. This is my code: function start() { return new Promise((resolve, reject) { this.server = Http.createServer(app); th...
Euripus asked 25/10, 2017 at 13:30

1

Solved

I am targeting ES2018 and do not care about ES3 or ES5. From my tsconfig.json: "target": "ES2018". tsc complains: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make ...
Pusillanimity asked 1/10, 2018 at 14:56

4

Solved

How can I change the following code so that both async operations are triggered and given an opportunity to run concurrently? const value1 = await getValue1Async(); const value2 = await getValue2A...
Melodramatic asked 23/10, 2017 at 12:24

3

Solved

I have create a class in nodejs class ApnService { sendNotification(deviceType, deviceToken, msg, type, id) { try { const note = await apnProvider.send(note, deviceToken) console.log(note) }...
Ilarrold asked 15/11, 2018 at 6:18

3

I would like to add support to async/await to node repl Following this issue: https://github.com/nodejs/node/issues/8382 I've tried to use this one https://github.com/paulserraino/babel-repl but ...

2

I have a method which returns a value from an element in the array. Not all the elements have the property I want to return. I would like to do this function with one line using the method find(). ...
Wiredraw asked 18/9, 2018 at 15:14

3

Solved

I started to use ES7 feature async/await , which gives the best approach to deal with asynchronous tasks, and makes your code cleaner and readable. However it doesn't give you an access to Promise...
Insensibility asked 9/11, 2016 at 1:21

1

Solved

Actually my main question was using Promise.prototype.catch() in async/await ES8 syntax, Undoubtedly Promise.prototype.then() is existed in essence of async/await syntax. I searched about using Pr...
Oncoming asked 16/5, 2018 at 14:15

2

Solved

Is there a way to use the TypeScript compiler only to remove type annotations, but not transpiling async functions? Something like a { target: 'esInfinite' } option? The reason is: There are browse...
Audit asked 7/10, 2016 at 14:4

1

I am wrapping a function returning a promises into an async function on a small helper function... trash(filesArray, { glob: false }) .then(() => { resolve(true); }).catch((err) => {...
Nanaam asked 15/4, 2018 at 13:1

4

Solved

Basically, function must be prefixed with async keyword if await used inside it. But if some function just returns Promise and doesn't awaiting for anything, should I mark the function as async? S...
Bedwell asked 22/5, 2017 at 7:22

3

Solved

Sometimes code would like to know if a particular function (or children) are running or not. For instance, node.js has domains which works for async stuff as well (not sure if this includes async f...
Bosky asked 12/3, 2018 at 17:30

1

If I use async/await function in a nested function call, I think the callers of that async/await functions should have async/await prefix. For example, in this situation: function a() { b(); } f...
Sink asked 6/3, 2018 at 2:34

2

Solved

This proposal suggests that async functions can use generator functions under the hood, although I cannot find a confirmation of this in ES2017 spec. Moreover, when generator prototype becomes mes...
Georgiegeorgina asked 24/10, 2017 at 10:50

3

Solved

I read about async/await, but I've a critical question. At first I explain an old example to show base of my question and then I ask my exact question. Everybody know it: console.log('1'); consol...
Jollanta asked 5/2, 2018 at 7:16

© 2022 - 2024 — McMap. All rights reserved.