Consolidated all sub-documents into character document to improve granularity significantly
Because just the top-level field changing invalidates everything in the sub-document, a single attribute change would trigger a re-calculation on all attributes and their dependents. This change should significantly improve performance.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{{>loginButtons}}
|
||||
<div>
|
||||
{{# each characters}}
|
||||
<li><a href="{{ pathFor 'character' }} ">{{_id}}</a> <button class="deleteChar">delete</button></li>
|
||||
<li><a href="{{ pathFor 'character' }} ">{{_id}}</a> <button id="deleteChar">delete</button></li>
|
||||
{{/each}}
|
||||
</div>
|
||||
<input id="addCharacter" type="button" value="Add Character">
|
||||
|
||||
@@ -2,7 +2,8 @@ Template.home.events({
|
||||
"click #addCharacter": function (event, template) {
|
||||
Characters.insert({});
|
||||
},
|
||||
"click .delete": function(event, template){
|
||||
"click #deleteChar": function(event, template){
|
||||
console.log("deleting", this);
|
||||
Characters.remove(this._id);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user