I would like to ask you about the request for list data. If you perform pull-down refresh and pull-up loading requests in the same interface, what is a more appropriate way to process the data when obtaining the request result?
My current approach is to pass the data into the same function, and then judge the request in the function. If it is refreshing, clear the data container, and then add the data. If it is not refreshing, add it directly, but it feels like the code is too complex to handle. It doesn’t look good, and you have to do repeated operations every time you process it, and there is no extraction.
Is there any better solution to this situation?
The interface generally requires the page parameter. Page=0 is usually a pull-down refresh