1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

pack main and renderer

This commit is contained in:
Kyle Spearrin
2018-01-23 13:59:01 -05:00
parent 0a803958e9
commit 268ec9960e
10 changed files with 136 additions and 82 deletions

View File

@@ -0,0 +1,21 @@
import { StorageService } from 'jslib/abstractions';
const Store = require('electron-store');
const store = new Store();
export class DesktopStorageService implements StorageService {
get<T>(key: string): Promise<T> {
const val = store.get(key) as T;
return Promise.resolve(val ? val : null);
}
save(key: string, obj: any): Promise<any> {
store.set(key, obj);
return Promise.resolve();
}
remove(key: string): Promise<any> {
store.delete(key);
return Promise.resolve();
}
}