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
We might want to switch to the second one; discussion is ongoing. For the first one, so far TC39 is hesitant about adding awaits implicitly, as it has rather big implications for synchronicity--each await queues you on the microtask queue, which is like giving up a big lock.
Thanks for the quick responses.
I agree that the first one has a big impact but that was just my 'reflex response'.
Good to see this discussion is ongoing.
I'm wondering what the reason is behind this syntax:
const userAge = userId |> fetchUserById |> await |> getAgeFromUser
I would expect the piping syntax to either implicitly handle awaitable code:
const userAge = userId |> fetchUserById |> getAgeFromUser
Or explicitly but with this cleaner variant:
const userAge = userId |> await fetchUserById |> getAgeFromUser
The current proposal confuses me. Can you make a comment on the reason behind it? Or on the alternatives I suggested?
The text was updated successfully, but these errors were encountered: