fix(core): update

This commit is contained in:
2022-01-24 06:39:36 +01:00
parent be505ee915
commit f7887a6663
12 changed files with 19435 additions and 3516 deletions

View File

@ -30,8 +30,17 @@ export class StatePart<TStatePartName, TStatePayload> {
* notifies of a change on the state
*/
public notifyChange() {
const createStateHash = (stateArg: any) => {
return plugins.isohash.sha256FromString(plugins.smartjson.stringify(stateArg));
};
if (this.stateStore && this.lastStateNotificationPayloadHash && createStateHash(this.stateStore) === createStateHash(this.lastStateNotificationPayloadHash)) {
return;
} else {
this.lastStateNotificationPayloadHash = this.stateStore;
}
this.state.next(this.stateStore);
}
private lastStateNotificationPayloadHash: any;
/**
* selects a state or a substate