Skip to content

Commit

Permalink
Merge pull request #10 from xliulian/master
Browse files Browse the repository at this point in the history
Fix update local field but not trigger change event.
  • Loading branch information
dmonad authored Apr 17, 2021
2 parents f1523a6 + c3e3a30 commit 8a70262
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions awareness.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ export class Awareness extends Observable {
setLocalStateField (field, value) {
const state = this.getLocalState()
if (state !== null) {
state[field] = value
this.setLocalState(state)
this.setLocalState({
...state,
[field]: value
})
}
}

Expand Down

0 comments on commit 8a70262

Please sign in to comment.