mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-24 19:21:39 +01:00
use generics here to say return type of method is same as callback
This commit is contained in:
parent
5b9fd5de94
commit
36da02c14e
@ -57,7 +57,7 @@ export class Transaction {
|
|||||||
return new Store(this._txn.objectStore(name), this);
|
return new Store(this._txn.objectStore(name), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
_store(name: StoreNames, mapStore: (idbStore: Store<any>) => any): any {
|
_store<T>(name: StoreNames, mapStore: (idbStore: Store<any>) => T): T {
|
||||||
if (!this._stores[name]) {
|
if (!this._stores[name]) {
|
||||||
const idbStore = this._idbStore(name);
|
const idbStore = this._idbStore(name);
|
||||||
this._stores[name] = mapStore(idbStore);
|
this._stores[name] = mapStore(idbStore);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user