nci/static/js/app/stores/project.js
2015-05-04 23:50:02 +03:00

20 lines
408 B
JavaScript

'use strict';
define([
'reflux', 'app/actions/project', 'app/resources'
], function(Reflux, ProjectActions, resources) {
var Store = Reflux.createStore({
init: function() {
this.listenTo(ProjectActions.readAll, this.readAll);
},
readAll: function() {
var self = this;
resources.projects.sync('read', function(err, projects) {
self.trigger(projects);
});
}
});
return Store;
});