This article provides an overview and how-to instructions for observing data changes within Ditto.
registerObserver
method, set up an observer within the store
namespace enclosed with a query that specifies the collection to watch for changes, as well as your logic to handle the incoming changes.
cancel
on the observer object.
Once canceled, the store observer will stop processing in the background and will no longer call the provided callback.