Skip to content

Commit 8a70262

Browse files
authored
Merge pull request yjs#10 from xliulian/master
Fix update local field but not trigger change event.
2 parents f1523a6 + c3e3a30 commit 8a70262

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

awareness.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ export class Awareness extends Observable {
141141
setLocalStateField (field, value) {
142142
const state = this.getLocalState()
143143
if (state !== null) {
144-
state[field] = value
145-
this.setLocalState(state)
144+
this.setLocalState({
145+
...state,
146+
[field]: value
147+
})
146148
}
147149
}
148150

0 commit comments

Comments
 (0)