observeChanges on React component lifecycle?

I was wondering what would be the best place to run an observeChanges function like the one shown in the attached image:

Where do I place it, componentDidMount(), componentWillReceiveProps()? What’s the best practice around this?

Thanks in advance,

The best place would be right after wherever you are subscribing to a publication that sends down the “current songs”. In fact a great place would be the “callback” function of that subscription.

1 Like

Thank you! It worked as expected :sunglasses:

1 Like