UNPKG

monaco-editor-core

Version:
33 lines 1.01 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { ConvenientObservable } from './baseObservable.js'; /** * Represents an efficient observable whose value never changes. */ export function constObservable(value) { return new ConstObservable(value); } class ConstObservable extends ConvenientObservable { constructor(value) { super(); this.value = value; } get debugName() { return this.toString(); } get() { return this.value; } addObserver(observer) { // NO OP } removeObserver(observer) { // NO OP } toString() { return `Const: ${this.value}`; } } //# sourceMappingURL=constObservable.js.map