mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-10 20:17:32 +01:00
Use generic T in LockMap
This commit is contained in:
parent
048547828d
commit
64a9892ee2
@ -16,10 +16,10 @@ limitations under the License.
|
|||||||
|
|
||||||
import {Lock} from "./Lock";
|
import {Lock} from "./Lock";
|
||||||
|
|
||||||
export class LockMap {
|
export class LockMap<T> {
|
||||||
private readonly _map: Map<unknown, Lock> = new Map();
|
private readonly _map: Map<T, Lock> = new Map();
|
||||||
|
|
||||||
async takeLock(key: unknown): Promise<Lock> {
|
async takeLock(key: T): Promise<Lock> {
|
||||||
let lock = this._map.get(key);
|
let lock = this._map.get(key);
|
||||||
if (lock) {
|
if (lock) {
|
||||||
await lock.take();
|
await lock.take();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user