mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-04 10:10:13 +00:00
refactor events and add unqi key
This commit is contained in:
parent
a1951016a9
commit
99c7dada7b
@ -1,4 +1,4 @@
|
|||||||
div
|
div
|
||||||
h2 projects list
|
h2 projects list
|
||||||
each project in items
|
each project, index in items
|
||||||
Item(item=project)
|
Item(item=project, key=project.name)
|
||||||
|
@ -5,15 +5,12 @@ define([
|
|||||||
], function(Reflux, ProjectActions, resources) {
|
], function(Reflux, ProjectActions, resources) {
|
||||||
var Store = Reflux.createStore({
|
var Store = Reflux.createStore({
|
||||||
init: function() {
|
init: function() {
|
||||||
this.listenTo(ProjectActions.load, this.load);
|
|
||||||
this.listenTo(ProjectActions.readAll, this.readAll);
|
this.listenTo(ProjectActions.readAll, this.readAll);
|
||||||
},
|
},
|
||||||
load: function(items) {
|
|
||||||
this.trigger(items);
|
|
||||||
},
|
|
||||||
readAll: function() {
|
readAll: function() {
|
||||||
|
var self = this;
|
||||||
resources.projects.sync('read', function(err, projects) {
|
resources.projects.sync('read', function(err, projects) {
|
||||||
ProjectActions.load(projects)
|
self.trigger(projects);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user