Make field protected so that Watchable can be extended
So that you can have custom watchables that have very specific behaviour, think `class NameWatchable extends Watchable`. Useful to have access to `listeners` when you do this.
This commit is contained in:
@@ -26,7 +26,7 @@ function isObject(value: unknown): value is object {
|
||||
* @public
|
||||
*/
|
||||
export class Watchable<T> {
|
||||
private readonly listeners = new Set<WatchFn<T>>();
|
||||
protected readonly listeners = new Set<WatchFn<T>>();
|
||||
|
||||
public constructor(private currentValue: T) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user