Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb committed Dec 11, 2024
1 parent a64475f commit 785b6c9
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions src/shared/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand All @@ -68,7 +40,7 @@ class BaseBindable extends IBindable {
*
* @template T
*/
export class WritableProperty extends BaseBindable {
export class WritableProperty extends IBindable {
/**
* Constructs a Property<T> with an initial Value
* @param {T} initialvalue
Expand Down

0 comments on commit 785b6c9

Please sign in to comment.