-
Notifications
You must be signed in to change notification settings - Fork 6
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
possible mixin go-with #5
Comments
Thanks for this Zach! It looks great and makes a lot of sense to me. I want to keep ember-infinite-scroll as simple as possible so I don't think it makes sense to add this to the project itself. However, if you want to wrap this up as its own addon, I'd love to add a reference to it in the readme. I could also just add a link to this issue if you don't want to do that. Let me know what you think. |
I think adding a link in the README would be just fine instead of polluting the addon space. Thanks! |
Oh, I forgot that I tweaked one of the methods in the mixin to work better. /**
* Returns the array of data to be added to iterable, wrapped in a Promise
* @param model
* @returns {RSVP.Promise}
*/
populateIterable: function (model) {
var chunkSize = this.get('chunkSize'),
iterableLength = this.get('iterable.length'),
newData = model.slice(iterableLength, iterableLength + chunkSize);
var promise = new Ember.RSVP.Promise(function (resolve, reject) {
Ember.run(null, resolve, newData);
});
return promise;
}, |
Awesome. Just added a link in the README. Thanks again Zach! |
First off, just wanted to say thanks a lot for this gem! I ended up creating a mixin to go alongside it since I didn't actually need to asynchronously request more data. I'm posting it here in case you have any suggestions or want to incorporate it somehow.
The text was updated successfully, but these errors were encountered: