Use this tag for questions about features finalized in ECMAScript 2017. Do *not* use this tag if the code in question merely *uses* one of the features, *unless* the feature is cause of the problem.
I creating an object that uses async function methods with babel-polyfill/babel-preset-es2017, however I am having a problem with this:
let obj = () => {
return {
doAsync: async () => {
let thing = await longProcess()
…
Im using the async function inside the object to send a response in express.js
Controller Code :
module.exports = {
async signUpEmail(req, res) {
/**
* @description Parameters from body
* @param {string} firstName -…
I have a slew of async functions I'm using and I'm having a weird issue.
My code, working, looks like:
async mainAsyncFunc (metadata) {
let files = metadata.map(data => this.anotherAsyncFunc(data.url));
return…
I'm new to Node and created an app that has some async/await syntax in it like so:
const express = require('express');
const app = express();
const someLibrary = require('someLibrary');
function asyncWrap(fn) {
return (req, res, next) => {
…
I just came to the painful realization that generator functions cannot be used with await. Only promises or async functions.
My team built an entire application with all modules consisting of generator functions, with one call to the Co module from…
I have the following very basic code which is part of a more complex problem.
My problem here is the function: context.decodeAudioData(arrayBuffer) is not working on iPhone (tried on Safari and Chrome) nor Mac (Safari), but it works everywhere else…
I'm compiling my javascript files with Laravel mix, and as I am not very knowledgeable yet on Babel and package.json, I want to ask if Laravel Mix supports ES8, especially async/await?
If I try it, I can't tell if Mix is transpiling async/await to…
How can I catch the geolocation specific error to notify the user that they must have geolocation turned on?
The catch logs an error called PositionError as referenced here in the Mozilla docs…
I'm working on a TypeScript project and we're using ES2017 as the output target, as well as one of the libs, because it'll then go through Babel, and we want to support the latest feature set for whatever "Env" we're targeting in Babel.
Everything…
I'm using Node version 7.6.0 to try out the native async and await features.
I'm trying to figure out why my async call just hanging never actually resolves.
NLP module:
const rest = require('unirest')
const Redis = require('ioredis')
const redis =…
I was just reading about async functions and came across some similar features of ES2017. It has created a lot of confusion, I wanted to just ask:
What is the difference between async function, AsyncFunction (which is used to create an async…
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 syntax 'exportDefaultFrom' isn't currently enabled…
I would love to use Javascript ES6 and ES7 syntax (especially async/await, my new best friends) without transpiling. Is that even an option? And should it be an option?
It all depends on the sub-question: what Javascript engine does react-native…
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 project and / or editor?
How to add polyfill if e.g.…
Since await does not work inside Array.map or Array.reduce, can you do something like the following or would this be considered misuse of Promise.all? Normally, neo4j.session() would be awaited.
// inside a function
const QUERY = 'MATCH (n) RETURN…