snappymail/dev/Stores/User/Identity.js

29 lines
487 B
JavaScript
Raw Normal View History

2015-01-29 05:24:58 +08:00
(function () {
'use strict';
var
_ = require('_'),
ko = require('ko')
2015-01-29 05:24:58 +08:00
;
/**
* @constructor
*/
function IdentityUserStore()
{
this.identities = ko.observableArray([]);
this.identities.loading = ko.observable(false).extend({'throttle': 100});
this.identitiesIDS = ko.computed(function () {
return _.compact(_.map(this.identities(), function (oItem) {
return oItem ? oItem.id : null;
}));
}, this);
2015-01-29 05:24:58 +08:00
}
module.exports = new IdentityUserStore();
}());