snappymail/dev/Stores/User/Identity.jsx

19 lines
395 B
React
Raw Normal View History

2015-11-19 01:32:29 +08:00
import {_} from 'common';
import ko from 'ko';
class IdentityUserStore
{
constructor()
{
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(() => {
return _.compact(_.map(this.identities(), (item) => item ? item.id : null));
}, this);
}
}
2016-04-21 01:12:51 +08:00
2015-11-19 01:32:29 +08:00
module.exports = new IdentityUserStore();