fix(core): update
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user