Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new storage feature for the CollaborationCursor extension #2096

Merged

Conversation

hanspagel
Copy link
Contributor

@hanspagel hanspagel commented Oct 27, 2021

Add a storage

  • This PR introduces the new storage feature in the CollaborationCursor extension.

Before we’ve used an onUsers callback function to get the current list of other users out of the editor. Now we just provide an array that’s easily accessible and reactive (in Vue + React).

Before:

CollaborationCursor.configure({
  provider,
  onUpdate: users => {
    this.users = users
  },
})

After:

CollaborationCursor.configure({
  provider,
})

And access the current list of users:

editor.storage.collaborationCursor.users

Rename the user command to updateUser

  • I’ve deprecated the user command and renamed it to updateUser which fits the current naming scheme better.

Remove redundant code

Additional updates

  • Updated the docs
  • Marked old code as deprecated and adding warnings to the console
  • Updated all examples to use the new code

Feedback appreciated!

…deprecate users command and onUsers callback, clean up
@hanspagel hanspagel linked an issue Oct 27, 2021 that may be closed by this pull request
2 tasks
@hanspagel hanspagel changed the title Make use of the new storage feature for the CollaborationCursor extension Use the new storage feature for the CollaborationCursor extension Oct 27, 2021
@hanspagel hanspagel merged commit b004f1e into main Oct 28, 2021
@philippkuehn philippkuehn deleted the feature/add-storage-to-the-collaboration-cursor-feature branch November 9, 2021 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CollaborationCursor status event redundant?
1 participant