You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love you Droidcon NYC presentation! Now I'm trying to slowly move towards your MVI implementation. But I'm stuck trying to implement pagination in one of the data calls. It's hard to keep track of the current page in the stream-way of thinking. Do you have any suggestion on how this would be done in your sample code?
The text was updated successfully, but these errors were encountered:
JolandaVerhoef
changed the title
How would you handle pagination
How would you handle pagination?
Feb 9, 2018
That's a really good question! I'd make an intent for loadNextPage, and a property of loadedPages on the state. I would then have the view layer send the intent into the model layer. The Model layer would read that intent, check which pages have already been loaded according to the current state, and I would issue a new call to get the next page and mutate oldState to include adding the new page of results.
As you page, the data on the state itself would grow, and the state would contain the union of all loaded pages. At that point, it would be the view layer's responsibility to show a subset of the loaded pages.
I love you Droidcon NYC presentation! Now I'm trying to slowly move towards your MVI implementation. But I'm stuck trying to implement pagination in one of the data calls. It's hard to keep track of the current page in the stream-way of thinking. Do you have any suggestion on how this would be done in your sample code?
The text was updated successfully, but these errors were encountered: