I have a requirement to fetch a large amount of data from an API and implement pagination. After fetching each page of data, I need to make two additional API calls to create the desired value object, and then re-render the UI.
One of the APIs takes longer to respond, about 1 second longer than the other. So, I want to package and render the UI after receiving a response from one API, and then update my value object after the second API responds. I’ve implemented asynchronous calls for these two APIs.
However, I’m using Paging for pagination, and the UI is rendered when I return LoadResult.page. This still waits for all API calls to complete before rendering. Is there a way to achieve my requirement?