Files
poe-auto-pricer/app/services/storage.service.ts

26 lines
527 B
TypeScript

import Store from 'electron-store';
const store = new Store();
const storeUsername = (username: string) => {
store.set('user', username);
};
const storeSessionID = (sessionID: string) => {
store.set('sessionID', sessionID);
};
const getSessionID = (): string | undefined => {
return store.get('sessionID') || undefined;
};
const getUsername = (): string | undefined => {
return store.get('user') || undefined;
};
export const StorageService = {
getUsername,
getSessionID,
storeUsername,
storeSessionID,
};