-
-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Labels
Description
Promises are so ugly, especially when you have to chain multiple .Then()
blocks. So I tried to await
the promise instead, but it won't compile because they're not awaitable.
Now this might be just a misunderstanding of C# promises, coming from JavaScript ESNext, but isn't async
/await
basically the same thing as promises, but with much cleaner and nicer syntax?
As in, doesn't this code
RestClient.Get("/api/something")
.Then(response => {
Debug.Log(response.Text);
});
do the exact same thing as this one?
var response = await RestClient.Get("/api/something");
Debug.Log(response.Text);
Or at least it would if the promise could be awaited. Which would be awesome!
jdnichollsc, enpiech, fuji97, Xenetics, MeltdownInteractive and 1 more