I am now working on a project to get data from api and display in angular ag-grid. The problem is that getting data from api took a long time. It took up to 5-15 seconds to get reply while testing with postman. I thought about using lazy loading to separately request data per page.
However, I might have to re-call api again and again to show data in each page and will have problems for sorting and filtering. I tried searching tutorial examples but all of them are tested with rowData already inside the project. For me, I have to request from api. What should I do about it? Is it problem from api side?
For now, I am thinking that I will divide the data request from api into two phase. At first, I will request only about 20 rows of data from api and show it in ag-grid. As soon as the data loaded on screen, behind background, a new api call will be made to call all data and then update ag-grid. Is there any way to auto-update ag-grid as soon as data in rowData change? Is there any methods for recommendation?
P.S. We also create api so can make new api.