Skip to content

Commit

Permalink
Stop subscription when the template is destroyed. (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslagle committed Feb 25, 2016
1 parent ca9e870 commit c67d26c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/reactive_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ var getUpdateHandleForTemplate = function (template_instance) {
return template_instance.updateHandle;
};

Template.reactiveTable.onDestroyed(function() {
if (this.context.server && this.context.handle) {
this.context.handle.stop();
}
});

Template.reactiveTable.helpers({
'context': function () {
if (!Template.instance().context ||
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
summary: "A reactive table designed for Meteor",
version: "0.8.25",
version: "0.8.26",
name: "aslagle:reactive-table",
git: "https://github.com/aslagle/reactive-table.git"
});
Expand Down

0 comments on commit c67d26c

Please sign in to comment.