{"ScriptPreparationCode":"originalState = {\r\n a: {},\r\n b: {},\r\n c: {},\r\n d: {},\r\n e: {},\r\n f: {},\r\n g: {},\r\n h: {},\r\n i: {},\r\n j: {},\r\n k: {},\r\n l: {},\r\n m: {},\r\n n: {},\r\n o: {},\r\n p: {},\r\n q: {},\r\n r: {},\r\n s: {},\r\n t: {},\r\n u: {},\r\n v: {},\r\n w: {},\r\n x: {},\r\n y: {},\r\n z: {},\r\n}\r\nsecondState = {\r\n a: {},\r\n b: {},\r\n c: {},\r\n d: {},\r\n e: {},\r\n f: {},\r\n g: {},\r\n h: {},\r\n i: {},\r\n j: {},\r\n k: {},\r\n l: {},\r\n m: {},\r\n n: {},\r\n o: {},\r\n p: {},\r\n q: {},\r\n r: {},\r\n s: {},\r\n t: {},\r\n u: {},\r\n v: {},\r\n w: {},\r\n x: {},\r\n y: {},\r\n z: {},\r\n}\r\noriginalKeys = new Set([\u0027a\u0027]);\r\nfunction pickBy(obj, fn) {\r\n return Object.keys(obj).reduce((acc, key) =\u003E {\r\n if (fn(obj[key], key, obj)) {\r\n acc[key] = obj[key];\r\n }\r\n return acc;\r\n }, {});\r\n};\r\nproxy = new Proxy(secondState, {\r\n get: (_, prop) =\u003E\r\n originalKeys.has(prop)\r\n ? originalState[prop]\r\n : secondState[prop],\r\n});","TestCases":[{"Name":"Just spread","Code":"state = { ...originalState, ...pickBy(secondState, (v, k) =\u003E !originalKeys.has(k)) }","IsDeferred":false},{"Name":"new proxy everytime","Code":"p = new Proxy(secondState, {\r\n get: (_, prop) =\u003E\r\n originalKeys.has(prop)\r\n ? originalState[prop]\r\n : secondState[prop],\r\n});\r\np.a\r\np.b","IsDeferred":false},{"Name":"One time proxy","Code":"proxy.a\r\nproxy.b","IsDeferred":false}]}