pinafore/routes/_utils/safeLocalStorage.js

7 lines
218 B
JavaScript
Raw Normal View History

import localStorageMemory from 'localstorage-memory'
import { testHasLocalStorage } from './testStorage'
const safeLocalStorage = testHasLocalStorage() ? localStorage : localStorageMemory
export { safeLocalStorage }