snappymail/dev/Stores/User/Identity.js
djmaze dca0ff02ed Use jQuery.slim
Underscore.js _.uniq(_.compact( to native Array.filter((value, index, self) => !!value && self.indexOf(value) == index)
Underscore.js _.compact to native Array.filter(value => !!value)
Underscore.js _.uniq to native Array.filter((value, index, self) => self.indexOf(value) == index)
Underscore.js _.values to native Object.values
Underscore.js _.flatten to native Array.flat
Underscore.js _.union to native Array.concat + unique filter
Underscore.js _.reduce to native Array.reduce
Underscore.js _.escape replaced with advanced htmlspecialchars()
Underscore.js _.memoize replaced
Now Underscore.js is a slim custom version (only _.debounce, _.defer & _.throttle)
2020-07-23 16:06:16 +02:00

14 lines
362 B
JavaScript

import ko from 'ko';
class IdentityUserStore {
constructor() {
this.identities = ko.observableArray([]);
this.identities.loading = ko.observable(false).extend({ throttle: 100 });
this.identitiesIDS = ko.computed(
() => this.identities().map(item => (item ? item.id : null)).filter(value => !!value)
);
}
}
export default new IdentityUserStore();