New Promise Syntax Proposal
T.J. Crowder
tj.crowder at farsightsoftware.com
Mon Nov 6 15:39:25 UTC 2017
On Mon, Nov 6, 2017 at 3:23 PM, Jorge Téllez
<novohispano at gmail.com> wrote:
>
> I would like to propose a new syntax for promises for the next ECMAScript.
We already have a concise syntax for a function that returns a promise:
`async`:
```js
async function promiseFunction() {
// Do work here, throw exception to reject,
// perhaps use `await` to wait for other promises...
return theResult;
};
```
More:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
-- T.J. Crowder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171106/4bd2770c/attachment.html>
More information about the es-discuss
mailing list