AwaitKit
AwaitKit copied to clipboard
Can make Additions for `when(action1, action2...)` usages ?
for PromiseKit usage: when(xxx, xxx).then { r1, r2 in .... }
adding for AwaitKit? just like: let (r1, r2) = try await(xxx, xxx)
+1 for that
This would be so useful.
@yannickl Hey dude, I've been promoting this libraries' awesomeness every minute I get a chance to, and wrote a blog post on it. Reckon this task's a possibility? :-)
I don't know if I would support this syntax because If we start it requires to implements all the possible signature.
May be the Guarantee
would be better #30?
try await(when(t1, t2, t3))
I don't have time for the moment, so if someone want to implement this, he/she's welcome.
@J7mbo thank you for your support, that's nice!
Any updates on implementing Guarantee
?
@Qwerp-Derp I don't have time to implement something similar. But there is this alternative that is working:
let p1 = myPromise1()
let p2 = myPromise2()
let p3 = myPromise3()
try! await(when(fulfilled: [p1, p2, p3]))
The only drawback is that the when
method returns a Promise<Void>
so you can't retrieve the values.