mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 22:55:08 +00:00
32 lines
606 B
JavaScript
32 lines
606 B
JavaScript
'use strict';
|
|
|
|
define([
|
|
'underscore',
|
|
'reflux', 'app/actions/project', 'app/resources'
|
|
], function(_, Reflux, ProjectActions, resources) {
|
|
var resource = resources.projects;
|
|
|
|
var Store = Reflux.createStore({
|
|
listenables: ProjectActions,
|
|
project: null,
|
|
|
|
onChange: function(data, action) {
|
|
},
|
|
|
|
init: function() {
|
|
resource.subscribe('change', this.onChange);
|
|
},
|
|
|
|
onRead: function(params) {
|
|
var self = this;
|
|
resource.sync('read', params, function(err, project) {
|
|
if (err) throw err;
|
|
self.project = project;
|
|
self.trigger(self.project);
|
|
});
|
|
}
|
|
});
|
|
|
|
return Store;
|
|
});
|