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

Done handlers not called if promise already resolved #27

Closed
MontakOleg opened this issue Jan 19, 2018 · 1 comment
Closed

Done handlers not called if promise already resolved #27

MontakOleg opened this issue Jan 19, 2018 · 1 comment

Comments

@MontakOleg
Copy link
Contributor

This code will print 5:

let promise = Promise<Int>(queue: DispatchQueue.global())
promise.done { result in
    print(result)
}
promise.resolve(5)

But this is not:

let promise = Promise<Int>(queue: DispatchQueue.global())
promise.resolve(5)
promise.done { result in
    print(result)
}

This behavior is by design?

@vadymmarkov
Copy link
Owner

@MontakOleg Yes, this is by design as far as I remember. Could be improved though.

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

No branches or pull requests

2 participants