Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can make Additions for when(action1, action2...) usages ? #28

Open
yangzhixiao opened this issue Mar 16, 2018 · 6 comments
Open

Can make Additions for when(action1, action2...) usages ? #28

yangzhixiao opened this issue Mar 16, 2018 · 6 comments

Comments

@yangzhixiao
Copy link

for PromiseKit usage:
when(xxx, xxx).then { r1, r2 in
....
}

adding for AwaitKit? just like:
let (r1, r2) = try await(xxx, xxx)

@yangzhixiao yangzhixiao changed the title Can make Additions for when(action1, action2...) issues ? Can make Additions for when(action1, action2...) usages ? Mar 16, 2018
@igor9silva
Copy link

+1 for that

@J7mbo
Copy link

J7mbo commented Mar 28, 2018

This would be so useful.

@J7mbo
Copy link

J7mbo commented Sep 2, 2018

@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? :-)

@yannickl
Copy link
Owner

yannickl commented Sep 5, 2018

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!

@hanyuone
Copy link

Any updates on implementing Guarantee?

@yannickl
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants