Browse Source

explainer: Fix non-short-circuiting |?> example

See https://github.com/tc39/proposal-pipeline-operator/issues/198#issuecomment-920950302.
pull/236/head
J. S. Choi 1 month ago
committed by GitHub
parent
commit
3c15cec7c4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md

2
README.md

@ -963,7 +963,7 @@ and `for (of) |>` would consecutively bind each of its iterator’s values to `^
A **short-circuiting** optional-pipe operator `|?>` could also be useful,
much in the way `?.` is useful for optional method calls.
For example, `value |> ^ != null ? await foo(^) : ^ |> ^ != null ? ^ + 1 : ^`\
For example, `value |> (^ == null ? ^ : await foo(^) |> (^ == null ? ^ : ^ + 1))`\
would be equivalent to `value |?> await foo(^) |?> ^ + 1`.
### Tacit unary function application

Loading…
Cancel
Save