drupal-elm-starter
drupal-elm-starter copied to clipboard
Add PagedWebData to the items [6h]
Currently we have very few items, but we could add more, and then fetch all the items one page at a time
/cc @rohanorton
@rgrempel gave some explanation about this:
Now, PagedWebData would be a little like our friend WebData from RemoteData, except that it would have another state, in which some pages have been received but others have not. To create one, you'd supply an Http.Builder that's partly filled out (i.e. everything but the page parameter), so that PagedWebData itself can send additional requests to get additional data. (So, it would be hooked into the event handling). And the UI can then do the right thing to display things ... i.e. display a "loading" indicator until all data loaded, or display what data we have + a loading indicator, or whatever is the right thing for the situation. Now, there would be a few more things to deal with, but the basic idea would be to have a PagedWebData module that would abstract out the work of sending requests and managing the pages and the count.