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

Adding a Promise library? #62

Open
zetachang opened this issue Feb 2, 2017 · 3 comments
Open

Adding a Promise library? #62

zetachang opened this issue Feb 2, 2017 · 3 comments

Comments

@zetachang
Copy link

This might be helpful for composing async tasks.

@lrz
Copy link
Member

lrz commented Feb 2, 2017

Might be interesting indeed! If you wish to contribute it feel free :)

@zetachang
Copy link
Author

Good to know!

Also, I think it might be helpful if async API could also return a Promise like React Native did (and still support callback/block API)

Location.geocode('apple inc').then do |location|
  puts location.address
end.rescue |error|
  puts error
end

@lrz
Copy link
Member

lrz commented Feb 2, 2017

Indeed, we could change the existing APIs to return a Promise instead. But I guess we need to figure out the initial API and implementation first.

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