diff --git a/README.md b/README.md index a91ca9f..0370ca2 100644 --- a/README.md +++ b/README.md @@ -94,30 +94,7 @@ As you can see, because the pipe operator always pipes a single result value, it ### Use of `await` -The pipeline operator allows the result of a `Promise`-returning function to be `await`ed as follows: - - -```js -x |> await f -``` - -which is the equivalent of - -```js -await f(x) -``` - -This is to allow you to `await` the result of an asynchronous function and pass it to the next function from within a function pipeline, as follows: - -```js -const userAge = userId |> await fetchUserById |> getAgeFromUser -``` - -which is the equivalent of - -```js -const userAge = getAgeFromUser(await fetchUserById(userId)) -``` +The current minimal proposal makes `|> await f` an early error, so there is no support currently for `await` in the pipeline. Each proposal has a different solution to `await` in a pipeline, so support is planned. Please see the respective proposals for their solutions. ### Usage with `?` partial application syntax diff --git a/spec.html b/spec.html index 00bda19..1dbadc1 100644 --- a/spec.html +++ b/spec.html @@ -36,7 +36,6 @@

Syntax

LogicalORExpression[?In, ?Yield, ?Await] [~Await] PipelineExpression[?In, ?Yield, ?Await] `|>` LogicalORExpression[?In, ?Yield, ?Await] [+Await] PipelineExpression[?In, ?Yield, ?Await] `|>` [lookahead <! {`await`}] LogicalORExpression[?In, ?Yield, ?Await] - [+Await] PipelineExpression[?In, ?Yield, ?Await] `|>` `await` LogicalORExpression[?In, ?Yield, ?Await] @@ -81,11 +80,6 @@

Runtime Semantics: Evaluation

1. Let _result_ be the result of PipelineEvaluate for |PipelineExpression| and |LogicalORExpression|. 1. Return _result_. - PipelineExpression : PipelineExpression `|>` `await` LogicalORExpression - - 1. Let _result_ be the result of PipelineEvaluate for |PipelineExpression| and |LogicalORExpression|. - 1. Return ? AsyncFunctionAwait(_result_). - PipelineExpression : LogicalORExpression 1. Return the result of evaluating |LogicalORExpression|.