mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +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";
|
||||
|
||||
export class LockMap {
|
||||
private readonly _map: Map<unknown, Lock> = new Map();
|
||||
export class LockMap<T> {
|
||||
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);
|
||||
if (lock) {
|
||||
await lock.take();
|
||||
|
Loading…
Reference in New Issue
Block a user