Currently seeking guidance on the most effective way to accomplish the following task using MeteorJS.
The requirements are as follows: a list with items and a sidebar with a selected item (not necessarily from the current page of the list).
https://i.sstatic.net/wiPGk.png
I need to send two sets of the same Items collection to the client:
- items for the current page of the list
- one item for the sidebar
What steps should I take in terms of publications/subscriptions?
It is unclear to me how to correctly implement this.
Currently, I have created two publications for the list and selected item, subscribed to both on the client side. As a result, when I use Items.find() on the client to populate the list, it returns the items for the list page as well as the selected item ("Item 5" shows up on the first page).
This works fine when the selected item should be on the current page of the list ("Item 2"), but it causes an issue when the selected item should not be there yet appears on the current page anyway ("Item 5").