UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

34 lines (27 loc) 602 B
import { AbstractAsyncMap } from "./AbstractAsyncMap.js"; /** * Wraps synchronous {@link Map}-implementing object * @template K,V */ export class AsyncMapWrapper extends AbstractAsyncMap { /** * * @type {Map<K,V>} * @private */ #source = null; /** * * @param {Map<K,V>} [source] */ constructor(source = new Map()) { super(); this.#source = source; } async get(key) { return this.#source.get(key); } async set(key, value) { this.#source.set(key, value); } }