Properly encode session store

This commit is contained in:
Danila Fedorin 2021-08-12 13:04:41 -07:00
parent f390d21881
commit ea4de29975

View file

@ -15,10 +15,15 @@ limitations under the License.
*/ */
import {Store} from "../Store" import {Store} from "../Store"
export class SessionStore { export interface SessionEntry {
private _sessionStore: Store<any> key: string
value: any
}
constructor(sessionStore: Store<any>) { export class SessionStore {
private _sessionStore: Store<SessionEntry>
constructor(sessionStore: Store<SessionEntry>) {
this._sessionStore = sessionStore; this._sessionStore = sessionStore;
} }
@ -29,11 +34,11 @@ export class SessionStore {
} }
} }
set(key: IDBValidKey, value: any) { set(key: string, value: any) {
this._sessionStore.put({key, value}); this._sessionStore.put({key, value});
} }
add(key: IDBValidKey, value: any) { add(key: string, value: any) {
this._sessionStore.add({key, value}); this._sessionStore.add({key, value});
} }