although there is a better way which notedeck does: don't care about eose and just render things as they stream in. this is faster but not really best ux since it looks a bit crazy
Discussion
This method is too complex for me. It's too easy to fall into performance traps. You know in theory how the code works but it's difficult to trace or debug. You can design a UI around it but the UI needs to break "is_loading" out into multiple steps, or use a queue. Plus you have to manage active REQs, potentially merging new queries into them. The dumb and easy way is to treat REQs like http requests that you cache and refetch in response to user actions (eg user scrolls back to the top after scrolling down).
I avoid all the complexity by simply dumping all results into nostrdb. Then the entire app becomes a single relay subscription from the point view of the ui. A relay that loads instantly and offline.
Yes, this is what I did with Ditto and it's a very good system. You essentially build a relay into your client. You have to be committed to making it perfect though, or it will be a huge crux.