Skip to content

Document creating multiple pollers in single injection #1

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

Closed
rayshan opened this issue Jan 8, 2014 · 2 comments
Closed

Document creating multiple pollers in single injection #1

rayshan opened this issue Jan 8, 2014 · 2 comments
Assignees

Comments

@rayshan
Copy link

rayshan commented Jan 8, 2014

Hi, thanks for the module, it's very well done and full-featured. May I recommend documenting how to create multiple instances for multiple resources within a single injection? E.g.:

var myPoller1 = new poller.get(myResource1);
var myPoller2 = new poller.get(myResource2);

Then poller.stopAll() would make more sense and one can use $q.all() and map the responses.

@emmaguo emmaguo closed this as completed in a328ffa Jan 9, 2014
@ghost ghost assigned emmaguo Jan 9, 2014
@emmaguo
Copy link
Owner

emmaguo commented Jan 9, 2014

Hi Ray, thank you for your feedback! I have updated the document based on your suggestion.

Unfortunately you can not use $q.all with multiple pollers since Angular does not support notification forwarding for $q.all yet: angular/angular.js#2223 (comment).

@rayshan
Copy link
Author

rayshan commented Jan 9, 2014

Thanks Emma! And that was a good read. $q needs a lot of work (angular/angular.js#5223), but now that ES6 is coming and Q's API differs from the standard (http://www.html5rocks.com/en/tutorials/es6/promises/#toc-javascript-promises), I wonder if they'll refactor the pollyfill with something like RSVP.js.

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