Skip to content

Commit

Permalink
feat: add isChangeOrigin helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Oct 3, 2021
1 parent 4feb4ee commit 92b6c5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/extension-collaboration/package.json
Expand Up @@ -24,6 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.3.4",
"y-prosemirror": "^1.0.9"
},
"repository": {
Expand Down
@@ -0,0 +1,6 @@
import { ySyncPluginKey } from 'y-prosemirror'
import { Transaction } from 'prosemirror-state'

export function isChangeOrigin(transaction: Transaction): boolean {
return !!transaction.getMeta(ySyncPluginKey)
}
1 change: 1 addition & 0 deletions packages/extension-collaboration/src/index.ts
@@ -1,5 +1,6 @@
import { Collaboration } from './collaboration'

export * from './collaboration'
export * from './helpers/isChangeOrigin'

export default Collaboration

0 comments on commit 92b6c5b

Please sign in to comment.