refactor: temporary jank
This commit is contained in:
parent
e0933ade6d
commit
b63a15c8a4
|
@ -12,11 +12,9 @@ export class Informed extends decorate(Trait) {
|
|||
|
||||
initialize() {
|
||||
this.entityReducer = this.createIndexedReducer();
|
||||
this._informState = I.fromJS({
|
||||
// Let the client know who they are.
|
||||
selfEntity: this.entity.instanceUuid,
|
||||
});
|
||||
this._informState = I.Map();
|
||||
this._packer = new Packer();
|
||||
this._sentSelf = false;
|
||||
this._socket = undefined;
|
||||
}
|
||||
|
||||
|
@ -111,6 +109,14 @@ export class Informed extends decorate(Trait) {
|
|||
inform: (stateSynchronizer) => {
|
||||
// Take diff.
|
||||
let diff = stateSynchronizer.diff(this._informState);
|
||||
if (!this._sentSelf) {
|
||||
diff.unshift({
|
||||
op: 'add',
|
||||
path: '/selfEntity',
|
||||
value: this.entity.instanceUuid,
|
||||
});
|
||||
this._sentSelf = true;
|
||||
}
|
||||
this._informState = stateSynchronizer.state;
|
||||
// Emit!
|
||||
if (diff) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user