mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
WS: improve Observable implementation
This commit is contained in:
parent
842b989e19
commit
1369076c14
5 changed files with 28 additions and 25 deletions
|
|
@ -30,8 +30,12 @@ export class Component extends Observable {
|
|||
return this._channel;
|
||||
}
|
||||
|
||||
on (property, callback) {
|
||||
this.addObserver(property, (self) => callback(self[property]));
|
||||
on (event, callback) {
|
||||
this.addObserver(event, callback);
|
||||
}
|
||||
|
||||
notify (property) {
|
||||
this.notifyObservers(property, this['_' + property]);
|
||||
}
|
||||
|
||||
send (node, addr, val) {
|
||||
|
|
@ -48,7 +52,7 @@ export class Component extends Observable {
|
|||
|
||||
updateLocal (property, value) {
|
||||
this['_' + property] = value;
|
||||
this.notifyObservers(property);
|
||||
this.notify(property);
|
||||
}
|
||||
|
||||
updateRemote (property, value, node, addr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue