{"action":"created","comment":{"url":"https://api.github.com/repos/meteor/meteor/pulls/comments/23050559","id":23050559,"diff_hunk":"@@ -56,6 +62,52 @@ Blaze.isTemplate = function (t) {\n   return (t instanceof Blaze.Template);\n };\n \n+/**\n+ * @name  onCreated\n+ * @instance\n+ * @memberOf Template\n+ * @summary Add a callback when an instance of a template is created.\n+ * @param {Function} callback A function to be added as a callback.\n+ * @locus Client\n+ */\n+Template.prototype.onCreated = function (cb) {\n+  this._callbacks.created.push(cb);\n+};\n+\n+/**\n+ * @name  onRendered\n+ * @instance\n+ * @memberOf Template\n+ * @summary Add a callback when an instance of a template is rendered.\n+ * @param {Function} callback A function to be added as a callback.\n+ * @locus Client\n+ */\n+Template.prototype.onRendered = function (cb) {\n+  this._callbacks.rendered.push(cb);\n+};\n+\n+/**\n+ * @name  onDestroyed\n+ * @instance\n+ * @memberOf Template\n+ * @summary Add a callback when an instance of a template is destroyed.","path":"packages/blaze/template.js","position":45,"original_position":45,"commit_id":"ec7c7afba02a2d12fd43a40003b52f5b3bee6517","original_commit_id":"ec7c7afba02a2d12fd43a40003b52f5b3bee6517","user":{"login":"stubailo","id":448783,"avatar_url":"https://avatars.githubusercontent.com/u/448783?v=3","gravatar_id":"","url":"https://api.github.com/users/stubailo","html_url":"https://github.com/stubailo","followers_url":"https://api.github.com/users/stubailo/followers","following_url":"https://api.github.com/users/stubailo/following{/other_user}","gists_url":"https://api.github.com/users/stubailo/gists{/gist_id}","starred_url":"https://api.github.com/users/stubailo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stubailo/subscriptions","organizations_url":"https://api.github.com/users/stubailo/orgs","repos_url":"https://api.github.com/users/stubailo/repos","events_url":"https://api.github.com/users/stubailo/events{/privacy}","received_events_url":"https://api.github.com/users/stubailo/received_events","type":"User","site_admin":false},"body":"\"Register a function to be called when an instance of this template is removed from the DOM and destroyed.\" (I'm not 100% sure, basically we should describe what destroyed means)","created_at":"2015-01-15T22:45:36Z","updated_at":"2015-01-15T22:45:36Z","html_url":"https://github.com/meteor/meteor/pull/3171#discussion_r23050559","pull_request_url":"https://api.github.com/repos/meteor/meteor/pulls/3171","_links":{"self":{"href":"https://api.github.com/repos/meteor/meteor/pulls/comments/23050559"},"html":{"href":"https://github.com/meteor/meteor/pull/3171#discussion_r23050559"},"pull_request":{"href":"https://api.github.com/repos/meteor/meteor/pulls/3171"}}},"pull_request":{"url":"https://api.github.com/repos/meteor/meteor/pulls/3171","id":24933247,"html_url":"https://github.com/meteor/meteor/pull/3171","diff_url":"https://github.com/meteor/meteor/pull/3171.diff","patch_url":"https://github.com/meteor/meteor/pull/3171.patch","issue_url":"https://api.github.com/repos/meteor/meteor/issues/3171","number":3171,"state":"open","locked":false,"title":"Add onEvent methods to Template","user":{"login":"Slava","id":2608446,"avatar_url":"https://avatars.githubusercontent.com/u/2608446?v=3","gravatar_id":"","url":"https://api.github.com/users/Slava","html_url":"https://github.com/Slava","followers_url":"https://api.github.com/users/Slava/followers","following_url":"https://api.github.com/users/Slava/following{/other_user}","gists_url":"https://api.github.com/users/Slava/gists{/gist_id}","starred_url":"https://api.github.com/users/Slava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slava/subscriptions","organizations_url":"https://api.github.com/users/Slava/orgs","repos_url":"https://api.github.com/users/Slava/repos","events_url":"https://api.github.com/users/Slava/events{/privacy}","received_events_url":"https://api.github.com/users/Slava/received_events","type":"User","site_admin":false},"body":"Add `Template#onCreated`, `Template#onRendered` and `Template#onDestroyed` methods. These are better than assigning `Template.rendered`, etc properties as you can add more than 1 of them w/o overriding previously added event handlers.\r\n\r\nRan test-packages for Blaze.\r\n\r\n@avital @dgreensp","created_at":"2014-11-24T13:53:04Z","updated_at":"2015-01-15T22:45:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e277674a81b4a856734ce2bbc1c4f6200d41faa7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/meteor/meteor/pulls/3171/commits","review_comments_url":"https://api.github.com/repos/meteor/meteor/pulls/3171/comments","review_comment_url":"https://api.github.com/repos/meteor/meteor/pulls/comments/{number}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/3171/comments","statuses_url":"https://api.github.com/repos/meteor/meteor/statuses/ec7c7afba02a2d12fd43a40003b52f5b3bee6517","head":{"label":"meteor:templateEventsMethods","ref":"templateEventsMethods","sha":"ec7c7afba02a2d12fd43a40003b52f5b3bee6517","user":{"login":"meteor","id":789528,"avatar_url":"https://avatars.githubusercontent.com/u/789528?v=3","gravatar_id":"","url":"https://api.github.com/users/meteor","html_url":"https://github.com/meteor","followers_url":"https://api.github.com/users/meteor/followers","following_url":"https://api.github.com/users/meteor/following{/other_user}","gists_url":"https://api.github.com/users/meteor/gists{/gist_id}","starred_url":"https://api.github.com/users/meteor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteor/subscriptions","organizations_url":"https://api.github.com/users/meteor/orgs","repos_url":"https://api.github.com/users/meteor/repos","events_url":"https://api.github.com/users/meteor/events{/privacy}","received_events_url":"https://api.github.com/users/meteor/received_events","type":"Organization","site_admin":false},"repo":{"id":3214406,"name":"meteor","full_name":"meteor/meteor","owner":{"login":"meteor","id":789528,"avatar_url":"https://avatars.githubusercontent.com/u/789528?v=3","gravatar_id":"","url":"https://api.github.com/users/meteor","html_url":"https://github.com/meteor","followers_url":"https://api.github.com/users/meteor/followers","following_url":"https://api.github.com/users/meteor/following{/other_user}","gists_url":"https://api.github.com/users/meteor/gists{/gist_id}","starred_url":"https://api.github.com/users/meteor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteor/subscriptions","organizations_url":"https://api.github.com/users/meteor/orgs","repos_url":"https://api.github.com/users/meteor/repos","events_url":"https://api.github.com/users/meteor/events{/privacy}","received_events_url":"https://api.github.com/users/meteor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/meteor/meteor","description":"Meteor, an ultra-simple, database-everywhere, data-on-the-wire, pure-Javascript web framework.","fork":false,"url":"https://api.github.com/repos/meteor/meteor","forks_url":"https://api.github.com/repos/meteor/meteor/forks","keys_url":"https://api.github.com/repos/meteor/meteor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meteor/meteor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meteor/meteor/teams","hooks_url":"https://api.github.com/repos/meteor/meteor/hooks","issue_events_url":"https://api.github.com/repos/meteor/meteor/issues/events{/number}","events_url":"https://api.github.com/repos/meteor/meteor/events","assignees_url":"https://api.github.com/repos/meteor/meteor/assignees{/user}","branches_url":"https://api.github.com/repos/meteor/meteor/branches{/branch}","tags_url":"https://api.github.com/repos/meteor/meteor/tags","blobs_url":"https://api.github.com/repos/meteor/meteor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meteor/meteor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meteor/meteor/git/refs{/sha}","trees_url":"https://api.github.com/repos/meteor/meteor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meteor/meteor/statuses/{sha}","languages_url":"https://api.github.com/repos/meteor/meteor/languages","stargazers_url":"https://api.github.com/repos/meteor/meteor/stargazers","contributors_url":"https://api.github.com/repos/meteor/meteor/contributors","subscribers_url":"https://api.github.com/repos/meteor/meteor/subscribers","subscription_url":"https://api.github.com/repos/meteor/meteor/subscription","commits_url":"https://api.github.com/repos/meteor/meteor/commits{/sha}","git_commits_url":"https://api.github.com/repos/meteor/meteor/git/commits{/sha}","comments_url":"https://api.github.com/repos/meteor/meteor/comments{/number}","issue_comment_url":"https://api.github.com/repos/meteor/meteor/issues/comments/{number}","contents_url":"https://api.github.com/repos/meteor/meteor/contents/{+path}","compare_url":"https://api.github.com/repos/meteor/meteor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meteor/meteor/merges","archive_url":"https://api.github.com/repos/meteor/meteor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meteor/meteor/downloads","issues_url":"https://api.github.com/repos/meteor/meteor/issues{/number}","pulls_url":"https://api.github.com/repos/meteor/meteor/pulls{/number}","milestones_url":"https://api.github.com/repos/meteor/meteor/milestones{/number}","notifications_url":"https://api.github.com/repos/meteor/meteor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meteor/meteor/labels{/name}","releases_url":"https://api.github.com/repos/meteor/meteor/releases{/id}","created_at":"2012-01-19T01:58:17Z","updated_at":"2015-01-15T21:55:14Z","pushed_at":"2015-01-15T20:28:40Z","git_url":"git://github.com/meteor/meteor.git","ssh_url":"git@github.com:meteor/meteor.git","clone_url":"https://github.com/meteor/meteor.git","svn_url":"https://github.com/meteor/meteor","homepage":"www.meteor.com","size":139304,"stargazers_count":21882,"watchers_count":21882,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2417,"mirror_url":null,"open_issues_count":325,"forks":2417,"open_issues":325,"watchers":21882,"default_branch":"devel"}},"base":{"label":"meteor:devel","ref":"devel","sha":"5a70c72dd6a603d46c9de7553a3e8044d3019e00","user":{"login":"meteor","id":789528,"avatar_url":"https://avatars.githubusercontent.com/u/789528?v=3","gravatar_id":"","url":"https://api.github.com/users/meteor","html_url":"https://github.com/meteor","followers_url":"https://api.github.com/users/meteor/followers","following_url":"https://api.github.com/users/meteor/following{/other_user}","gists_url":"https://api.github.com/users/meteor/gists{/gist_id}","starred_url":"https://api.github.com/users/meteor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteor/subscriptions","organizations_url":"https://api.github.com/users/meteor/orgs","repos_url":"https://api.github.com/users/meteor/repos","events_url":"https://api.github.com/users/meteor/events{/privacy}","received_events_url":"https://api.github.com/users/meteor/received_events","type":"Organization","site_admin":false},"repo":{"id":3214406,"name":"meteor","full_name":"meteor/meteor","owner":{"login":"meteor","id":789528,"avatar_url":"https://avatars.githubusercontent.com/u/789528?v=3","gravatar_id":"","url":"https://api.github.com/users/meteor","html_url":"https://github.com/meteor","followers_url":"https://api.github.com/users/meteor/followers","following_url":"https://api.github.com/users/meteor/following{/other_user}","gists_url":"https://api.github.com/users/meteor/gists{/gist_id}","starred_url":"https://api.github.com/users/meteor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteor/subscriptions","organizations_url":"https://api.github.com/users/meteor/orgs","repos_url":"https://api.github.com/users/meteor/repos","events_url":"https://api.github.com/users/meteor/events{/privacy}","received_events_url":"https://api.github.com/users/meteor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/meteor/meteor","description":"Meteor, an ultra-simple, database-everywhere, data-on-the-wire, pure-Javascript web framework.","fork":false,"url":"https://api.github.com/repos/meteor/meteor","forks_url":"https://api.github.com/repos/meteor/meteor/forks","keys_url":"https://api.github.com/repos/meteor/meteor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meteor/meteor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meteor/meteor/teams","hooks_url":"https://api.github.com/repos/meteor/meteor/hooks","issue_events_url":"https://api.github.com/repos/meteor/meteor/issues/events{/number}","events_url":"https://api.github.com/repos/meteor/meteor/events","assignees_url":"https://api.github.com/repos/meteor/meteor/assignees{/user}","branches_url":"https://api.github.com/repos/meteor/meteor/branches{/branch}","tags_url":"https://api.github.com/repos/meteor/meteor/tags","blobs_url":"https://api.github.com/repos/meteor/meteor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meteor/meteor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meteor/meteor/git/refs{/sha}","trees_url":"https://api.github.com/repos/meteor/meteor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meteor/meteor/statuses/{sha}","languages_url":"https://api.github.com/repos/meteor/meteor/languages","stargazers_url":"https://api.github.com/repos/meteor/meteor/stargazers","contributors_url":"https://api.github.com/repos/meteor/meteor/contributors","subscribers_url":"https://api.github.com/repos/meteor/meteor/subscribers","subscription_url":"https://api.github.com/repos/meteor/meteor/subscription","commits_url":"https://api.github.com/repos/meteor/meteor/commits{/sha}","git_commits_url":"https://api.github.com/repos/meteor/meteor/git/commits{/sha}","comments_url":"https://api.github.com/repos/meteor/meteor/comments{/number}","issue_comment_url":"https://api.github.com/repos/meteor/meteor/issues/comments/{number}","contents_url":"https://api.github.com/repos/meteor/meteor/contents/{+path}","compare_url":"https://api.github.com/repos/meteor/meteor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meteor/meteor/merges","archive_url":"https://api.github.com/repos/meteor/meteor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meteor/meteor/downloads","issues_url":"https://api.github.com/repos/meteor/meteor/issues{/number}","pulls_url":"https://api.github.com/repos/meteor/meteor/pulls{/number}","milestones_url":"https://api.github.com/repos/meteor/meteor/milestones{/number}","notifications_url":"https://api.github.com/repos/meteor/meteor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meteor/meteor/labels{/name}","releases_url":"https://api.github.com/repos/meteor/meteor/releases{/id}","created_at":"2012-01-19T01:58:17Z","updated_at":"2015-01-15T21:55:14Z","pushed_at":"2015-01-15T20:28:40Z","git_url":"git://github.com/meteor/meteor.git","ssh_url":"git@github.com:meteor/meteor.git","clone_url":"https://github.com/meteor/meteor.git","svn_url":"https://github.com/meteor/meteor","homepage":"www.meteor.com","size":139304,"stargazers_count":21882,"watchers_count":21882,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2417,"mirror_url":null,"open_issues_count":325,"forks":2417,"open_issues":325,"watchers":21882,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/meteor/meteor/pulls/3171"},"html":{"href":"https://github.com/meteor/meteor/pull/3171"},"issue":{"href":"https://api.github.com/repos/meteor/meteor/issues/3171"},"comments":{"href":"https://api.github.com/repos/meteor/meteor/issues/3171/comments"},"review_comments":{"href":"https://api.github.com/repos/meteor/meteor/pulls/3171/comments"},"review_comment":{"href":"https://api.github.com/repos/meteor/meteor/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/meteor/meteor/pulls/3171/commits"},"statuses":{"href":"https://api.github.com/repos/meteor/meteor/statuses/ec7c7afba02a2d12fd43a40003b52f5b3bee6517"}}}}