Thank you for the questions.
> How do you determine how far up in the expression tree you go?
I think this is a good question. When I go through various
expressions, it seems obvious to me given the intent of the operator
where to draw the line. In cases like `let x = ...`, `function() { ...
}`,
This operator doesn't make any sense to me. It has to know not only the
immediate expression to its left and/or right like normal operators.
It's **absolutely** not a unary operator, as it has to have information
about every outer operator. It's almost an inverted operator in that sense.
If we're
An expression which contains a `then` operator is not run
synchronously. It does not run until its `then` expressions are
resolved. It is like the body of a callback function, since the
statements following it will most likely run before it does.
The way I would implement this is by having certain
On Sat, Mar 3, 2018 at 1:04 AM, Bryant Petersen wrote:
> The purpose of `await` is to allow synchronous execution within an
> async function.
>
> The purpose of `then` is to make it easier to manipulate the promises
> as if they were normal values. It is much closer to
> `Promise.prototype.then` t
The purpose of `await` is to allow synchronous execution within an
async function.
The purpose of `then` is to make it easier to manipulate the promises
as if they were normal values. It is much closer to
`Promise.prototype.then` than to `await`, since it does not prevent
the statements following
Why not just use async/await then? Seems like if you were to replace `then`
with `await` in your top example it would work exactly as you want (as long
as it's in an async function).
On Sat, Mar 3, 2018 at 1:06 AM, Bryant Petersen
wrote:
> I've put the details here: https://github.com/bwpetersen
I've put the details here: https://github.com/bwpetersen/proposal-then-operator
The basic idea is that the `then` operator would allow you to
manipulate a promise as if it were its resolved value. Expressions
containing `then` become similar to an `onFulfillment` handler.
Here is an example:
```
7 matches
Mail list logo