I am stuck on a simple pattern (I am sure I am missing something important).
I have a plugin that sets a selection using appendTransaction on certain circumstances. The way my app learns about any selection changes is through checking the selectionSet attribute in dispatchTransaction in the view and then emitting that to the outside. This works well for any changes but transactions that are appended by my plugin.
It seems (by design?) that transactions appended by plugins do not come through dispatchTransaction (probably because they are applied during the state update that usually happens within dispatchTransaction).
What would be the right pattern to emit my selection change? I have added an example for more clarity
Desired end result: I get a console log that the selection was set to 1 when I click anywhere into the text within the example. I am trying to only emit to the outside when dispatchTransaction is called to keep only one place where state is emitted.