You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we would like to access deep properties of the resolved data
awaitp.then(t=>t.a.b)
we could use (await p~.a).b. But it is ideal because if .b throws, the error will be thrown at a different frame.
However, users may find out, await p~.a~.b, which seems neater than (await p~.a).b, also work because it can desugar to
awaitp.then(t=>t.a).then(s=>s.b)
By this way the wavy-dot could encourage unnecessary chaining promise. The broader question, as I mentioned in tc39/proposal-eventual-send#18, is that the wavy dot, while provides convenience to chain promise, limits the syntax operation that you can perform on the retrieved data. In this case the data access have to be separated into another execution frame.
The text was updated successfully, but these errors were encountered:
If we would like to access deep properties of the resolved data
we could use
(await p~.a).b
. But it is ideal because if.b
throws, the error will be thrown at a different frame.However, users may find out,
await p~.a~.b
, which seems neater than(await p~.a).b
, also work because it can desugar toBy this way the wavy-dot could encourage unnecessary chaining promise. The broader question, as I mentioned in tc39/proposal-eventual-send#18, is that the wavy dot, while provides convenience to chain promise, limits the syntax operation that you can perform on the retrieved data. In this case the data access have to be separated into another execution frame.
The text was updated successfully, but these errors were encountered: