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
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
Just thought I'd point out that the proposal itself entertains the
possibility of a corresponding composition proposal [1]. Also, in my
proposal, one of my "potential expansions" [2] would open a generic
door for "lifting" over a type, addressing the concern of
extensibility. (It's not ideal, and
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
>
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:
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