简体   繁体   English

Hyperloop 可以使用最新的 Async/Await 吗?

[英]Can Hyperloop Work with the newest Async/Await?

I see that the examples on https://hyperstack.org/ describes making a fetch as a wrapper around priomsies.我看到https://hyperstack.org/上的示例将 fetch 描述为 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?我知道在 JS 中 async/await 是围绕 promise 的语法糖,但我很好奇我是否可以将 async/await 模式与 JS 周围的 Hyperloop ruby​​ 包装器一起使用?

Its not really needed.它不是真的需要。 Essentially Async/Await is some syntactic sugar that makes async control easier to use.本质上,Async/Await 是一些语法糖,使异步控制更易于使用。

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.在超堆栈中,您可以继续使用“老式”承诺(这就是 async/await 归结为),但它们同样易于理解且无需更多代码。

If you care to post an example of of JS code using Async/Await, I can update the answer with the Hyperstack equivilent.如果您想发布一个使用 Async/Await 的 JS 代码示例,我可以使用 Hyperstack equivilent 更新答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM