    return JSON.parse(decompressFromUTF16(serializedState)) as ISavedState;
  } catch (err) {
    console.log("error");
    return undefined;
  }
};

export const saveState = (state: IGlobalState) => {
  try {
    const stateToBeSaved: ISavedState = {
      playgroundEditorValue: state.playgroundEditorValue,
    };
    const serialized = compressToUTF16(JSON.stringify(stateToBeSaved));
    localStorage.setItem("storedState", serialized);
  } catch (err) {