Skip to content

Commit

Permalink
Easily expose stop() and run() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeno Rocha committed Jul 25, 2014
1 parent 3f03fc5 commit 209cd9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ function importBasicLifecycleMixin(mixin, Tracker) {

// Fires when the element was inserted into the document
mixin.attached = function() {
this.run();
};

mixin.run = function() {
if (this.trackerTask) {
this.trackerTask.run();
}
};

// Fires when the element was removed from the document
mixin.detached = function() {
this.stop();
};

mixin.stop = function() {
if (this.trackerTask) {
this.trackerTask.stop();
}
Expand Down

0 comments on commit 209cd9a

Please sign in to comment.