So I have a feed pretty much like a Facebook feed, displaying the 10 most recent posts and 3 most recent comments per post (I’m using reywood:publish-composite to publish the lot).
I’d like to fetch all comments for a single post when a user clicks on “Show all comments” for that post. One way to do this is to have another publication which takes and array of post IDs for which I fetch all the comments. However, wouldn’t that reload the comments for every post in the list every time I add a new ID?
Ideally I’d also like to put a limit on how many additional comment are fetched (i.e. “Show 10 previous comments”). The only way I can think of doing that is by storing a list of comment IDs inside each post and then subscribing to a list of comments using an array of comment IDs (adding the IDs of the 10 previous comments to the array when a user clicks “Show 10…”). But again, would that cause the entire subscription to be reloaded every time I add IDs?