{"ScriptPreparationCode":"//constant\r\nwindow.itemOptions = {\r\n\t\u00271\u0027: \u00271\u0027,\r\n \t\u00272\u0027: \u00272\u0027,\r\n \t\u00273\u0027: \u00273\u0027,\r\n \t\u00274\u0027: \u00274\u0027,\r\n};\r\n\r\n//example object\r\nwindow.stateObject = {\r\n\titem1: \u002700000\u0027,\r\n \titem2: \u002750\u0027,\r\n \titem3: [],\r\n \titem4: [window.itemOptions[\u00271\u0027]],\r\n \titem5: [],\r\n};\r\n\r\nlocalStorage.setItem(\u0027stateObject\u0027, JSON.stringify(window.stateObject));\r\n","TestCases":[{"Name":"setting localStorage unconditionally (simulating 1 React rerender after mount)","Code":"localStorage.setItem(\u0027stateObject\u0027, JSON.stringify(window.stateObject));\r\nlocalStorage.setItem(\u0027stateObject\u0027, JSON.stringify(window.stateObject));","IsDeferred":false},{"Name":"setting localStorage conditionally (simulating 1 React rerender after mount)","Code":"const storedState = JSON.parse(localStorage.getItem(\u0027stateObject\u0027));\r\nif (!_.isEqual(window.stateObject, storedState)) {\r\n\tlocalStorage.setItem(\u0027stateObject\u0027, JSON.stringify(window.stateObject));\r\n}\r\nif (!_.isEqual(window.stateObject, storedState)) {\r\n\tlocalStorage.setItem(\u0027stateObject\u0027, JSON.stringify(window.stateObject));\r\n}","IsDeferred":false}]}