// onStateChanged: Fired when plugin state has changed (annotation added, removed, etc)
// This is a way to watch global plugin state, as an alternative to watching various annotation events
plugin.registerListener('onStateChanged', (event) => {
// event.detail = annotation state data
});
Currently there is no alternatives for this event in emitters api, it may be tricky to roll updated state using atomic operations. And it will be great to allow full rerender just passing new state data into some event emitter.
Any luck figuring this out @lifeart ? Even I want to re-initialize the plugin with new data when a new comment/annotation is received from the backend api.
We have listener
// onStateChanged: Fired when plugin state has changed (annotation added, removed, etc) // This is a way to watch global plugin state, as an alternative to watching various annotation events
plugin.registerListener('onStateChanged', (event) => { // event.detail = annotation state data });
Currently there is no alternatives for this event in emitters api, it may be tricky to roll updated state using atomic operations. And it will be great to allow full rerender just passing new state data into some event emitter.