mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49: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
|
|
@ -64,10 +64,6 @@ export class MailMessageList extends AbstractViewRight {
|
|||
|
||||
this.messageList = MessageUserStore.list;
|
||||
|
||||
this.sortSupported = ko.computed(() =>
|
||||
FolderUserStore.hasCapability('SORT') | FolderUserStore.hasCapability('ESORT')
|
||||
);
|
||||
|
||||
this.composeInEdit = AppUserStore.composeInEdit;
|
||||
|
||||
this.isMobile = ThemeStore.isMobile;
|
||||
|
|
@ -107,6 +103,9 @@ export class MailMessageList extends AbstractViewRight {
|
|||
|
||||
this.addComputables({
|
||||
|
||||
sortSupported: () =>
|
||||
FolderUserStore.hasCapability('SORT') | FolderUserStore.hasCapability('ESORT'),
|
||||
|
||||
folderMenuForMove: () =>
|
||||
folderListOptionsBuilder(
|
||||
[FolderUserStore.currentFolderFullName()],
|
||||
|
|
|
|||
|
|
@ -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