snappymail/dev/Stores/User/Account.js
the-djmaze e324e2f6b6 Replaced tricky delegateRunOnDestroy() with koArrayWithDestroy()
koArrayWithDestroy creates ko.observableArray and calls the desired onDestroy() on entry delete.
2022-02-17 12:48:57 +01:00

13 lines
343 B
JavaScript

import { addObservablesTo, koArrayWithDestroy } from 'External/ko';
export const AccountUserStore = {
accounts: koArrayWithDestroy(),
loading: ko.observable(false).extend({ debounce: 100 }),
getEmailAddresses: () => AccountUserStore.accounts.map(item => item.email)
};
addObservablesTo(AccountUserStore, {
email: '',
signature: ''
});