Ember Data's moved on quite a bit since I wrote my pull request, so I'd need to do it again. I've decided to lay out the case here and if you and the other members of the team feel it's a good idea then I'll do it again.
Here's the approach that I'm advocating:
- Whenever the store asks the adapter to fetch some records a
Request
object (a new class) is created that contains the information required to request another page of results. - The
Request
object is also used to contain thesinceToken
that's currently there - The
meta
object that's returned from the server is then attached to theRequest
object, which is attached to the returnedRecordArray
so that downstream users of theRecordArray
(eg.ArrayController
s) have access to the page number, page size and the total number of records RecordArray
s would have two new methods:fetchPage()
andfetchMore()
, which would use the information in theRequest
object to perform another fetch from the server.- Adapters can control the para