Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
10d1bb35ce | |||
8e97b51f1f | |||
7159b33425 | |||
5860066621 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/webstore",
|
"name": "@pushrocks/webstore",
|
||||||
"version": "1.0.9",
|
"version": "1.0.11",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/webstore",
|
"name": "@pushrocks/webstore",
|
||||||
"version": "1.0.9",
|
"version": "1.0.11",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "high performance storage in the browser using indexed db",
|
"description": "high performance storage in the browser using indexed db",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -5,7 +5,7 @@ export interface IWebStoreOptions {
|
|||||||
storeName: string;
|
storeName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WebStore<T = any> {
|
export class WebStore<T> {
|
||||||
public db: plugins.idb.IDBPDatabase;
|
public db: plugins.idb.IDBPDatabase;
|
||||||
public objectStore: plugins.idb.IDBPObjectStore;
|
public objectStore: plugins.idb.IDBPObjectStore;
|
||||||
public options: IWebStoreOptions;
|
public options: IWebStoreOptions;
|
||||||
@ -22,7 +22,7 @@ export class WebStore<T = any> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async get(key: string) {
|
async get(key: string): Promise<T> {
|
||||||
return this.db.get(this.options.storeName, key);
|
return this.db.get(this.options.storeName, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user