@furystack/utils
Advanced tools
Comparing version 3.0.1 to 3.0.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ObservableValue = void 0; | ||
exports.ObservableValue = exports.ObservableAlreadyDisposedError = void 0; | ||
const value_observer_1 = require("./value-observer"); | ||
/** | ||
* Error thrown when you try to retrieve or set an observable value that is already disposed. | ||
*/ | ||
class ObservableAlreadyDisposedError extends Error { | ||
constructor() { | ||
super('Observable already disposed'); | ||
} | ||
} | ||
exports.ObservableAlreadyDisposedError = ObservableAlreadyDisposedError; | ||
/** | ||
* Defines an ObservableValue value object. | ||
@@ -78,3 +87,3 @@ * | ||
if (this._isDisposed) { | ||
throw new Error('ObservableValue is already disposed'); | ||
throw new ObservableAlreadyDisposedError(); | ||
} | ||
@@ -90,3 +99,3 @@ return this.currentValue; | ||
if (this._isDisposed) { | ||
throw new Error('ObservableValue is already disposed'); | ||
throw new ObservableAlreadyDisposedError(); | ||
} | ||
@@ -93,0 +102,0 @@ if (this.currentValue !== newValue) { |
{ | ||
"name": "@furystack/utils", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "General utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,2 +5,11 @@ import { Disposable } from './disposable' | ||
/** | ||
* Error thrown when you try to retrieve or set an observable value that is already disposed. | ||
*/ | ||
export class ObservableAlreadyDisposedError extends Error { | ||
constructor() { | ||
super('Observable already disposed') | ||
} | ||
} | ||
/** | ||
* Callback type for observable value changes | ||
@@ -81,3 +90,3 @@ */ | ||
if (this._isDisposed) { | ||
throw new Error('ObservableValue is already disposed') | ||
throw new ObservableAlreadyDisposedError() | ||
} | ||
@@ -94,3 +103,3 @@ return this.currentValue | ||
if (this._isDisposed) { | ||
throw new Error('ObservableValue is already disposed') | ||
throw new ObservableAlreadyDisposedError() | ||
} | ||
@@ -97,0 +106,0 @@ if (this.currentValue !== newValue) { |
import { Disposable } from './disposable'; | ||
import { ValueObserver } from './value-observer'; | ||
/** | ||
* Error thrown when you try to retrieve or set an observable value that is already disposed. | ||
*/ | ||
export declare class ObservableAlreadyDisposedError extends Error { | ||
constructor(); | ||
} | ||
/** | ||
* Callback type for observable value changes | ||
@@ -5,0 +11,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153938
2693