mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-12 19:35:08 +00:00
26 lines
585 B
JavaScript
26 lines
585 B
JavaScript
|
'use strict';
|
||
|
|
||
|
define([
|
||
|
'reflux', 'app/actions/project', 'app/resources'
|
||
|
], function(Reflux, ProjectActions, resources) {
|
||
|
var resource = resources.projects;
|
||
|
|
||
|
var Store = Reflux.createStore({
|
||
|
listenables: ProjectActions,
|
||
|
onRun: function(projectName) {
|
||
|
resource.sync('run', {projectName: projectName}, function(err, result) {
|
||
|
console.log('run project, shoould get queue');
|
||
|
});
|
||
|
},
|
||
|
onReadAll: function() {
|
||
|
var self = this;
|
||
|
resource.sync('readAll', function(err, projects) {
|
||
|
if (err) throw err;
|
||
|
self.trigger(projects);
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return Store;
|
||
|
});
|