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
Is your feature request related to a problem? Please describe.
Javascript has a promise system similar to the one offered by this crate. However, it also comes with a big problem called Callback Hell, which basically looks like this:
The solution JS opted for is to introduce the await keyword. Since this crate is supposed to be language agnostic, it should instead add a method for that functionality.
This is important because, if you want to use more than one value from rust at a time, you would have to nest the callbacks, like so:
Is your feature request related to a problem? Please describe.
Javascript has a promise system similar to the one offered by this crate. However, it also comes with a big problem called Callback Hell, which basically looks like this:
The solution JS opted for is to introduce the
await
keyword. Since this crate is supposed to be language agnostic, it should instead add a method for that functionality.This is important because, if you want to use more than one value from rust at a time, you would have to nest the callbacks, like so:
Describe the solution you'd like
With the
:await()
method, the above code should look like this. Much nicer:The await method should wait until the callback function returns, and then give back the final value.
Additional context
Nested callbacks look ugly
The text was updated successfully, but these errors were encountered: