mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 06:27:02 +03:00
Switch from ko.computed to ko.pureComputed
This should provide performance and memory benefits over regular computed observables
This commit is contained in:
parent
ac2238a23f
commit
954de06f86
18 changed files with 55 additions and 37 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import ko from 'ko';
|
||||
import { isArray } from 'Common/Utils';
|
||||
import { koComputable } from 'External/ko';
|
||||
|
||||
/*
|
||||
oCallbacks:
|
||||
|
|
@ -28,8 +29,8 @@ export class Selector {
|
|||
sItemFocusedSelector
|
||||
) {
|
||||
this.list = koList;
|
||||
this.listChecked = ko.computed(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||
this.isListChecked = ko.computed(() => 0 < this.listChecked().length);
|
||||
this.listChecked = koComputable(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||
this.isListChecked = koComputable(() => 0 < this.listChecked().length);
|
||||
|
||||
this.focusedItem = koFocusedItem || ko.observable(null);
|
||||
this.selectedItem = koSelectedItem || ko.observable(null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue