From 785b6c90b1a22b76cf257875b8ad18f308c97a7b Mon Sep 17 00:00:00 2001 From: Sebastian Streich Date: Wed, 11 Dec 2024 17:39:16 +0100 Subject: [PATCH] remove dead code --- src/shared/property.js | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/shared/property.js b/src/shared/property.js index 4e4290a3..6763be2e 100644 --- a/src/shared/property.js +++ b/src/shared/property.js @@ -31,34 +31,6 @@ export class IBindable { } } -class BaseBindable extends IBindable { - /** @returns {T} */ - get value() { - return this.#innerValue; - } - /** - * - * @param {(T)=>void} callback - This callback will be called when the value changes - * @returns {()=>void} unsubscribe function, this will stop all callbacks - */ - subscribe(callback) { - const unsubscribe = () => { - this.#subscriptions = this.#subscriptions.filter((t) => t !== callback); - }; - this.#subscriptions.push(callback); - queueMicrotask(() => callback(this.#innerValue)); - return unsubscribe; - } - /** - * @type {Array<(arg0: T)=>void> } - */ - #subscriptions = []; - /** - * @type {T} - */ - #innerValue; -} - /** * A property similar to Q_Property * Holds an internal value that can be modified using `.set(NewValue)` @@ -68,7 +40,7 @@ class BaseBindable extends IBindable { * * @template T */ -export class WritableProperty extends BaseBindable { +export class WritableProperty extends IBindable { /** * Constructs a Property with an initial Value * @param {T} initialvalue