- The one described above. Where the
PaginatedList would expose a way to fetch next pages (batch of elements or List<>)
- Let the Library expose 2 API's -
PaginatedList fetchData() -> client would call this one initially
PaginatedList fetchNextPage(PaginatedList) -> client would call this for sub-sequent pages
- This one is slightly modified version of approach 2. Let library expose a modified
fetchData()
PaginatedList fetchData(PaginatedList list) -> initially client would need to create a new PaginatedList(), which would initialize it's state like pageToProcess = 0; This API kind of takes in the metadata associated with the service call to identify which page to get next
- The one described above. Where the
PaginatedList would expose a way to fetch next pages (batch of elements or List<>)
- Let the Library expose 2 API's -
PaginatedList fetchData()
-> client would call this one initially
PaginatedList fetchNextPage(PaginatedList)
-> client would call this for sub-sequent pages
This one is slightly modified version of approach 2. Let library expose a modified
fetchData()
PaginatedList fetchData(PaginatedList list)
-> initially client would need to create anew PaginatedList()
, which would initialize it's state likepageToProcess = 0;
This API kind of takes in the metadata associated with the service call to identify which page to get next