"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ObservableMap = void 0;
class ObservableMap extends Map {
    listeners = new Set();
    set(key, value) {
        super.set(key, value);
        this.listeners.forEach((listener) => listener(this));
    }
    get(key) {
        return super.get(key);
    }
    addListener(listener) {
        this.listeners.add(listener);
    }
    removeListener(listener) {
        this.listeners.delete(listener);
    }
}
exports.ObservableMap = ObservableMap;
