Skip to content

Commit

Permalink
СB-4018 fix: TempDataContext mobx subscriptions works correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
s.teleshev committed Mar 1, 2024
1 parent ba050d8 commit e1281de
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ export class TempDataContext implements IDataContext {

getOwn<T>(context: DataContextGetter<T>): T | undefined {
this.atom.reportObserved();
const targetOwn = this.target.getOwn(context);

if (this.map.has(context)) {
return this.map.get(context);
}

return this.target.getOwn(context);
return targetOwn;
}

set<T>(context: DataContextGetter<T>, value: T): DeleteVersionedContextCallback {
Expand Down Expand Up @@ -178,6 +180,8 @@ export class TempDataContext implements IDataContext {
for (const [key, value] of this.map) {
this.target.set(key, value);
}

this.atom.reportChanged();
}

private planFlush(): void {
Expand Down

0 comments on commit e1281de

Please sign in to comment.