@global-savings-group/extension-storage
v0.3.1
Published
Cross-browser storage service for browser extensions
Downloads
149
Readme
Cross-browser storage service for browser extensions
Usage
import { localStorageService, sessionStorageService } from '@global-savings-group/extension-storage';
setTimeout(async () => {
const localData = await localStorageService.get('key') ?? 1000;
await localStorageService.set('key', localData + 1);
console.log(`Local data: ${localData}`);
const sessionData = await sessionStorageService.get('key') ?? 2000;
await sessionStorageService.set('key', sessionData + 1);
console.log(`Session data: ${sessionData}`);
}, 5000);