# Promise chaining operator

**URL:** <https://es.discourse.group/t/promise-chaining-operator/1747>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [June 28, 2023, 7:36am UTC](https://es.discourse.group/t/promise-chaining-operator/1747 "2023-06-28T07:36:08Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mhofman](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@mhofman](https://es.discourse.group/u/mhofman)\
**Post date:** [June 28, 2023, 6:03pm UTC](https://es.discourse.group/t/promise-chaining-operator/1747/3 "2023-06-28T18:03:22Z")

</div>

Additionally, please see previous discussions on this topic:

> [@Async property accessor: -\>](https://es.discourse.group/t/async-property-accessor/765):
>
> The idea is to access a property of an awaited value to allow deep chaining of async operations. Right now, to accomplish that kind of chaining you need to write: const baz = await (await (await fetchFoo()).fetchBar()).fetchBaz(); That can get pretty awkward pretty fast. My idea is a new operator that accomplishes this without all the nested parens: const baz = await fetchFoo()-\>fetchBar()-\>fetchBaz(); Additionally, they can be optionally chained like the other property accessors: const ba…

> [@bang await chaining operator](https://es.discourse.group/t/bang-await-chaining-operator/940):
>
> // this is verbose const response = await fetch('/posts') const posts = await response.json() // chaining multiple await expressions in one line is awkward const posts = await (await fetch('/posts')).json() // proposal: chain together multiple awaits with !. const posts = await fetch('/posts')!.json()

> [@The "future-seeing-arrow" proposal.](https://es.discourse.group/t/the-future-seeing-arrow-proposal/1626):
>
> The idea is to provide a new -\> "operator", that conceptually serves a similar purpose as a "." in a fluent-API, however, it's given a special super-power. The initial function in the chain will be allowed to see everything that happens in the chain of -\>, and is in charge of executing everything in the chain. In reality, the -\> syntax is just a simple syntax sugar that decomposes into an array of tuples. Here's an example. // With the `-\>` operator let data = beginAnimation({ duration: '10ms'…

---

_[View the full topic](https://es.discourse.group/t/promise-chaining-operator/1747)._
