UNPKG

@atlaskit/page-layout

Version:

A collection of components which let you compose an application's page layout.

11 lines 498 B
import { PAGE_LAYOUT_LS_KEY } from './constants'; import safeLocalStorage from './safe-local-storage'; export var removeFromGridStateInStorage = function removeFromGridStateInStorage(key, secondKey) { var storageValue = JSON.parse(safeLocalStorage().getItem(PAGE_LAYOUT_LS_KEY) || '{}'); if (secondKey && storageValue[key]) { delete storageValue[key][secondKey]; } else { delete storageValue[key]; } safeLocalStorage().setItem(PAGE_LAYOUT_LS_KEY, JSON.stringify(storageValue)); };