refactor collaboration example

This commit is contained in:
Hans Pagel
2020-11-30 14:12:19 +01:00
parent 6f3517a5cf
commit 442eba8c96
7 changed files with 51 additions and 429 deletions

View File

@@ -46,7 +46,8 @@ const CollaborationCursor = Extension.create({
* Update details of the current user
*/
user: (attributes: { [key: string]: any }): Command => () => {
this.options.provider.awareness.setLocalStateField('user', attributes)
this.options.user = attributes
this.options.provider.awareness.setLocalStateField('user', this.options.user)
this.options.onUpdate(awarenessStatesToArray(this.options.provider.awareness.states))
return true