Comments (4)
How would you suggest the engine be statically able to know that asyncOne
does not depend on anything in asyncTwo
? Here, await
is statically indicating that it does depend on it.
from proposal-async-await.
Note that this isn't just "late stage", this is finished - ie, stage 4.
Syntactic sugar for await Promise.all(…)
existed very early in this proposal, but was largely rejected, as I understand it (await*
)
from proposal-async-await.
After giving it more thought I realised that this change could break existing code (as asyncTwo could expect some external value to be changed by asyncOne)... so for that reason I doubt this is worth considering for such a late stage proposal. Also, you're right that the static analysis is tricky as asyncOne could dynamically choose external values to change at runtime.
Perhaps there would be scope for an additional keyword which means 'await in parallel', and which allows the developer to specify which Promises can be awaited in parallel. Which would be little more than syntactic sugar around await Promise.all()
, but would contribute to the sync/async symmetry that async/await aims towards.
from proposal-async-await.
Syntactic sugar for await Promise.all(…) existed very early in this proposal, but was largely rejected, as I understand it (await*)
Yep, exactly.
from proposal-async-await.
Related Issues (20)
- How do you yield* with async/await? HOT 5
- Async arrow functions don't work with default destructed parameters. HOT 1
- server.asyncawait.js uses `await*` syntax
- Question: 'await' is a keyword? HOT 3
- Play sounds when messages are received by both admins and users HOT 1
- Clarify the relationship between loops and async HOT 5
- Error in javascript discord bot HOT 1
- A question about async await with native promise. HOT 7
- Spec example needs a tiny fix. HOT 2
- await in spawn HOT 1
- New syntax HOT 1
- > > Btw, what's the case of exporting async function atm? Can't imagine a single one, even if it's a valid syntax. HOT 2
- node google spreadsheet i want to fetch a particular cell HOT 1
- async
- Forbidden Extensions (16.2) should apply to async functions, as they do to Generators HOT 1
- NOTE 1 for Async Function Definitions says different things than rules HOT 1
- Update of "State of this proposal" pharagraph in https://tc39.github.io/ecmascript-asyncawait/ HOT 8
- Throw if ClassHeritage is an async function! HOT 1
- Exceptions swallowed by design? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-async-await.