snappymail/dev/Stores/User/Identity.js

17 lines
368 B
JavaScript
Raw Normal View History

2015-11-19 01:32:29 +08:00
2016-07-02 06:49:59 +08:00
import _ from '_';
2015-11-19 01:32:29 +08:00
import ko from 'ko';
class IdentityUserStore
{
2016-07-16 05:29:42 +08:00
constructor() {
2015-11-19 01:32:29 +08:00
this.identities = ko.observableArray([]);
2016-04-21 01:12:51 +08:00
this.identities.loading = ko.observable(false).extend({throttle: 100});
2015-11-19 01:32:29 +08:00
this.identitiesIDS = ko.computed(
() => _.compact(_.map(this.identities(), (item) => (item ? item.id : null))));
2015-11-19 01:32:29 +08:00
}
}
2016-04-21 01:12:51 +08:00
export default new IdentityUserStore();