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