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

Normalize parameters passed to infinityModel #11

Closed
bruce opened this issue Apr 8, 2015 · 1 comment
Closed

Normalize parameters passed to infinityModel #11

bruce opened this issue Apr 8, 2015 · 1 comment

Comments

@bruce
Copy link
Contributor

bruce commented Apr 8, 2015

Just a thought for a post #9 world.

The current API for infinityModel involves passing perPage and startingPage properties -- which are then converted to per_page and page parameters for the backend.

Once people start having the ability to pass arbitrary parameters to infinityModel, I can imagine (especially if they're simultaneously working on the backend API) they may accidentally provide page (vs startingPage) and per_page (vs perPage) options -- which would [currently] be ignored.

I think it might make sense that the logic is a bit more forgiving, eg:

var startingPage = options.startingPage || options.page || 1;
var perPage      = options.perPage || options.per_page || this.get('_perPage');
@hhff
Copy link
Collaborator

hhff commented Apr 8, 2015

👍 - I feel startingPage has a different purpose to page, as it is specific to the infinite scroll itself, but I do agree re: perPage.

Would love a PR on this!

@hhff hhff closed this as completed in 567bb06 Apr 8, 2015
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