Skip to content

Commit

Permalink
fix(context-data): avoid unnecessary sets on observable map
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 01095695d80c6dcd1d6171a6a7d428c87ce618bf
  • Loading branch information
IcaroG authored and actions-user committed Oct 21, 2024
1 parent d73df5d commit c72d68e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion platform/wab/src/wab/client/studio-ctx/view-ctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ import {
} from "@plasmicapp/react-web";
import asynclib from "async";
import $ from "jquery";
import L, { defer, groupBy, head } from "lodash";
import L, { defer, groupBy, head, isEqual } from "lodash";
import * as mobx from "mobx";
import { comparer, computed, observable } from "mobx";
import { computedFn } from "mobx-utils";
Expand Down Expand Up @@ -314,6 +314,10 @@ export class ViewCtx extends WithDbCtx {

createSetContextDataFn = computedFn((valKey: string) => {
return (value: any) => {
const oldValue = this._codeComponentValKeyToContextData.get(valKey);
if (isEqual(oldValue, value)) {
return;
}
globalHookCtx.frameValKeyToContextData.set(
mkFrameValKeyToContextDataKey(this.arenaFrame().uid, valKey),
value
Expand Down

0 comments on commit c72d68e

Please sign in to comment.