Fire standard change event when transaction changes state


#1

I’m integrating ProseMirror into a framework that expects the event normally generated by HTML5 inputs. In particular, I’d like for the widget that contains the PM editor to get a change event when I dispatch a transaction. It seems as though the way to do that would be to fire a change event from the dispatchTransaction property. Is that the best approach, or is there something already in ProseMirror to fire the standard events?


#2

ProseMirror doesn’t fire its own events, so yes, if you want something like that you must implement it.


#3

So what are the different methods provided by ProseMirror of hooking into changes?

So far I’ve found:

  • dispatchTransaction
  • update() in a plugin

#4

Those are all of them, pretty much.