mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +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
|
|
@ -20,6 +20,7 @@ import { ThemeStore } from 'Stores/Theme';
|
|||
import Remote from 'Remote/User/Fetch';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
//import { clearCache } from 'Common/Cache';
|
||||
//import { koComputable } from 'External/ko';
|
||||
|
||||
export class SystemDropDownUserView extends AbstractViewRight {
|
||||
constructor() {
|
||||
|
|
@ -32,8 +33,8 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
|||
this.accounts = AccountUserStore.accounts;
|
||||
this.accountsLoading = AccountUserStore.loading;
|
||||
/*
|
||||
this.accountsUnreadCount = : ko.computed(() => 0);
|
||||
this.accountsUnreadCount = : ko.computed(() => AccountUserStore.accounts().reduce((result, item) => result + item.count(), 0));
|
||||
this.accountsUnreadCount = : koComputable(() => 0);
|
||||
this.accountsUnreadCount = : koComputable(() => AccountUserStore.accounts().reduce((result, item) => result + item.count(), 0));
|
||||
*/
|
||||
|
||||
this.addObservables({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue