Observe Changes While Ignoring Initial Load

Hello, I am using observeChanges to detect changes to the database from client side. However, when the client first loads the page, the publication makes data available to the client which triggers the observeChanges. I would like to observeChanges after the initial data has been loaded. Any tips on how to accomplish this would be greatly appreciated!

Compare the values so to detect if there was a change

if(obj != oldObj){ ... something changed }

Are you saying to detect changes like this (instead of using observeChanges) or use this along with observeChanges? Would the same issues not occur with this method since oldObj would be empty on first load and when the publication data comes in it would be different and thus triggering the “change code”?

In case this helps, the use-case is to show alerts/notifications when new data has been created. Maybe there’s a completely different way of doing this that would be better? Any ideas would be appreciated, thanks.

Sorry for not being clear, Load a object first pre-render then check it on observe changes, but honestly you can just use pub/sub that’s what it’s built for and notifications works great with it.

Just load the subscription and have a Boolean on each notification called unread / read so you know if it’s new or not. You can order by a date so newest first and highlight the ones where unread is true. This is how my notifications work on my app, use server-render package to hit it pre-render so you don’t have to wait for the pub/sub to setup and you’re golden.