1

I see that the examples on https://hyperstack.org/ describes making a fetch as a wrapper around priomsies.

I know that in JS async/await is syntatic sugar around promises, but Im curious if I can use the async/await pattern with the Hyperloop ruby wrapper around JS?

Zack Weiner
  • 664
  • 4
  • 14
  • Worth looking at [the documentation](https://docs.hyperstack.org/isomorphic-dsl/hyper-operation#promises-and-operations). – tadman Jan 19 '20 at 05:26
  • there is some heavy duty name overloading going on here. Hyperstack was using the term async in Operations way before JS Async/Await came on the scene. But yes within an Operation track async works similar to JS async. Outside of an Operation though there is really no need for the Async construct as the Hyperstack promise syntax is equivilent in simplicity. – Mitch VanDuyn Jan 20 '20 at 02:11

1 Answers1

1

Its not really needed. Essentially Async/Await is some syntactic sugar that makes async control easier to use.

In hyperstack you can just go ahead and use the "old fashioned" promises (which is what async/await boil down to) but they are just as easy to understand and take no more code.

If you care to post an example of of JS code using Async/Await, I can update the answer with the Hyperstack equivilent.

Mitch VanDuyn
  • 2,838
  • 1
  • 22
  • 29