UNPKG

@empathyco/x-components

Version:
22 lines (19 loc) 665 B
import { BrowserStorageService } from '@empathyco/x-utils'; import { noOp } from './function.js'; /** * Service instance of {@link @empathyco/x-utils#StorageService | storage service} if * localStorage is available. * If not, required {@link @empathyco/x-utils#StorageService | storage service} functions * are initialized with empty implementations. * @internal */ const localStorageService = typeof localStorage !== 'undefined' ? new BrowserStorageService(localStorage, 'x') : { clear: noOp, getItem: noOp, setItem: noOp, removeItem: noOp, }; export { localStorageService }; //# sourceMappingURL=storage.js.map