/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
/**
 * Simple implementation of {@link Dependee}.
 *
 * @public
 */
export class SimpleDependee {
    constructor(computationName = "SimpleDependee") {
        this.computationName = computationName;
        this.dependents = new Set();
    }
    registerDependent(dependent) {
        if (this.dependents.has(dependent)) {
            return false;
        }
        this.dependents.add(dependent);
        return true;
    }
    removeDependent(dependent) {
        this.dependents.delete(dependent);
    }
    /**
     * Invalidates the dependents that have are dependent on this data.
     */
    invalidateDependents(token) {
        for (const dependent of this.dependents) {
            dependent.markInvalid(token);
        }
    }
    /**
     * @sealed
     */
    listDependents() {
        return this.dependents;
    }
}
//# sourceMappingURL=simpleDependee.js.map