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

Replies (1)

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).​