These are chat archives for opal/opal

8th
Feb 2018
Elthariel
@elthariel
Feb 08 2018 18:02
Hi folks ! Is there a way to synchronously wait for a promise ? I’m using opal-rspec and I want to use the result of a promise chain as a subject
Elia Schito
@elia
Feb 08 2018 18:03
@elthariel no, I don't think it's possible, the only way would be to implement async/await, but we're far from that now
Elthariel
@elthariel
Feb 08 2018 18:04
@elia, thanks. I guess there isn’t a JS-based hack to workaround the problem you could suggest
@elia: Oh, just had a look at async and await, I hear you, won’t be easy. Grazzie
Elia Schito
@elia
Feb 08 2018 18:06
Prego! :wink:
Frederic ZINGG
@fzingg
Feb 08 2018 18:06
@elthariel You can ask your question in HYPERLOOP chatroom, but I think HYPERLOOP Operation module can do that.
Elthariel
@elthariel
Feb 08 2018 18:09
@fzingg, I’m not sure that would fit well within the specs of a simple opal wrapper library :)
But they might give me pointers, I’ll go chat there tomorrow
Elthariel
@elthariel
Feb 08 2018 18:22
Actually, it kind of works out of the box oO
If you returns a Promise as a subject, it’ll wait for it to be resolved when used
That shit’s pretty amazing, tbh
Mitch VanDuyn
@catmando
Feb 08 2018 21:20
@fzingg not sure if you meant hyperoperation or hyperspec.
HyperOp does use promises as the standard return value, but more to @elthariel 's point hyper-spec, does have ability to isopmorhically test promises. But as noted it's pretty much built into opal-spec as well