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

Convert it to promise base #30

Open
malik-umair opened this issue Sep 29, 2016 · 1 comment
Open

Convert it to promise base #30

malik-umair opened this issue Sep 29, 2016 · 1 comment

Comments

@malik-umair
Copy link

Hi, I'm using this wonderful API and it worked perfectly. But I need it to be promise base as my whole application is promise base and this API return result few second late and script doesn't stop for it and bypass it. Is there a way I use it as promise base? Thanks!

@christopher-ramirez
Copy link

christopher-ramirez commented Sep 30, 2016

You can use the library with the ES6 Promise class or some of the promise similar libraries for pre ES6 environments; e.g.:

var promise = new Promise(function(resolve, reject) {
    Youtube.search('bla bla', 2, function(err, result) {
        resolve(result)
    }
})

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