mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Added addComputables() to *Model
This commit is contained in:
parent
22f606ea75
commit
b165a1de4f
6 changed files with 221 additions and 223 deletions
|
|
@ -41,6 +41,10 @@ export class AbstractModel {
|
|||
*/
|
||||
}
|
||||
|
||||
addComputables(obj) {
|
||||
Object.entries(obj).forEach(([key, fn]) => this[key] = ko.computed(fn) );
|
||||
}
|
||||
|
||||
addSubscribables(obj) {
|
||||
Object.entries(obj).forEach(([key, fn]) => this.disposables.push( this[key].subscribe(fn) ) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue