Skip to content

Commit

Permalink
fix: fix dispatchTransaction binding
Browse files Browse the repository at this point in the history
Bind dispatchTransaction so it is always called with the view instance as this
  • Loading branch information
optimistiks authored and d4rkr00t committed Jul 11, 2019
1 parent 52ca4cb commit c2d0ff4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/subscribe-on-updates.js
@@ -1,6 +1,7 @@
export default function subscribeOnUpdates(editorView, callback) {
const dispatch = editorView._props.dispatchTransaction ||
editorView.dispatch.bind(editorView);
const dispatch = (
editorView._props.dispatchTransaction || editorView.dispatch
).bind(editorView);

const handler = function(tr) {
const oldState = editorView.state;
Expand Down

0 comments on commit c2d0ff4

Please sign in to comment.