refactor: state diff

This commit is contained in:
cha0s 2019-04-05 23:14:17 -04:00
parent 8d0dd86488
commit 88d1634b8f
2 changed files with 5 additions and 2 deletions

View File

@ -28,7 +28,11 @@ export class WorldTime {
}
patchState(patch) {
this.hour = patch;
for (const {path, value} of patch) {
if ('/' === path) {
this.hour = value;
}
}
}
secondsPerHour() {

View File

@ -110,7 +110,6 @@ export class Informed extends decorate(Trait) {
// Take diff.
let diff = stateSynchronizer.diff(this._informState);
this._informState = stateSynchronizer.state;
diff = this.reduceStateDiff(diff);
// Emit!
if (diff) {
this._socket.send({type: 'state-update', payload: diff});