@empathyco/x-components
Version:
Empathy X Components
22 lines (19 loc) • 665 B
JavaScript
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