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

alternative for Q.delay and Q.finally #64

Closed
timaschew opened this issue Dec 5, 2014 · 1 comment
Closed

alternative for Q.delay and Q.finally #64

timaschew opened this issue Dec 5, 2014 · 1 comment

Comments

@timaschew
Copy link

I want to rewrite a library which using Q. I need it for the browser and using component, so I want to replace kriskowal/q with then/promise.

The code I want to rewrite uses Q.delay() and Q.finally(), do you know how I can rewrite it?

@ForbesLindesay
Copy link
Member

Q.delay(...) is just new Promise(function (resolve) { setTimeout(resolve, ...) }). It's something I have considered adding a method for on Promise, but it is non-standard and pretty simple for people to implement themselves.

Q.finaly just requires you to pass the same function to both .then handlers.

You should definitely check out browserify. It's like a way better version of component.

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