nci/static/js/app/stores/project.js

20 lines
408 B
JavaScript
Raw Normal View History

2015-05-03 23:04:51 +00:00
'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() {
2015-05-04 20:50:02 +00:00
var self = this;
2015-05-03 23:04:51 +00:00
resources.projects.sync('read', function(err, projects) {
2015-05-04 20:50:02 +00:00
self.trigger(projects);
2015-05-03 23:04:51 +00:00
});
}
});
return Store;
});