mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-23 14:26:18 +08:00

koArrayWithDestroy creates ko.observableArray and calls the desired onDestroy() on entry delete.
13 lines
343 B
JavaScript
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: ''
|
|
});
|