{"action":"created","comment":{"url":"https://api.github.com/repos/aurelia/templating-router/pulls/comments/28815696","id":28815696,"diff_hunk":"@@ -0,0 +1,40 @@\n+import {customAttribute, bindable} from 'aurelia-templating';\n+import {inject} from 'aurelia-dependency-injection';\n+import {Router} from 'aurelia-router';\n+import {TaskQueue} from 'aurelia-task-queue';\n+\n+@customAttribute('route-href')\n+@bindable({name: 'route', changeHandler: 'processChange'})\n+@bindable({name: 'params', changeHandler: 'processChange'})\n+@bindable({name: 'attribute', defaultValue: 'href'})\n+@inject(Router, Element, TaskQueue)\n+export class RouteHref {\n+  constructor(router, element, taskQueue) {\n+    this.router = router;\n+    this.element = element;\n+    this.taskQueue = taskQueue;\n+    this.isChangePending = false;\n+  }\n+\n+  attributeChanged(value, previous) {\n+    if (previous) {\n+      this.element.removeAttribute(previous);\n+    }\n+\n+    this.processChange();\n+  }\n+\n+  processChange() {\n+    if (!this.isChangePending) {\n+      this.isChangePending = true;\n+      this.taskQueue.queueMicroTask(this.updateAttribute.bind(this));\n+    }\n+  }\n+\n+  updateAttribute() {\n+    this.isChangePending = false;\n+\n+    let href = this.router.generate(this.route, this.params);","path":"src/route-href.js","position":37,"original_position":37,"commit_id":"5c43ab08778c8578bd704c831ee114adb73a133c","original_commit_id":"5c43ab08778c8578bd704c831ee114adb73a133c","user":{"login":"EisenbergEffect","id":131485,"avatar_url":"https://avatars.githubusercontent.com/u/131485?v=3","gravatar_id":"","url":"https://api.github.com/users/EisenbergEffect","html_url":"https://github.com/EisenbergEffect","followers_url":"https://api.github.com/users/EisenbergEffect/followers","following_url":"https://api.github.com/users/EisenbergEffect/following{/other_user}","gists_url":"https://api.github.com/users/EisenbergEffect/gists{/gist_id}","starred_url":"https://api.github.com/users/EisenbergEffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EisenbergEffect/subscriptions","organizations_url":"https://api.github.com/users/EisenbergEffect/orgs","repos_url":"https://api.github.com/users/EisenbergEffect/repos","events_url":"https://api.github.com/users/EisenbergEffect/events{/privacy}","received_events_url":"https://api.github.com/users/EisenbergEffect/received_events","type":"User","site_admin":false},"body":"Yes. You can implement the `bind` callback. When you have this, your property change callbacks will not be fired individually during the initial bind, but the `bind` callback will be called once everything is set up. Afterwords, the individual callbacks will be fired as the individual properties change. Does that make sense?","created_at":"2015-04-21T19:54:53Z","updated_at":"2015-04-21T19:54:53Z","html_url":"https://github.com/aurelia/templating-router/pull/4#discussion_r28815696","pull_request_url":"https://api.github.com/repos/aurelia/templating-router/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/aurelia/templating-router/pulls/comments/28815696"},"html":{"href":"https://github.com/aurelia/templating-router/pull/4#discussion_r28815696"},"pull_request":{"href":"https://api.github.com/repos/aurelia/templating-router/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/aurelia/templating-router/pulls/4","id":33611575,"html_url":"https://github.com/aurelia/templating-router/pull/4","diff_url":"https://github.com/aurelia/templating-router/pull/4.diff","patch_url":"https://github.com/aurelia/templating-router/pull/4.patch","issue_url":"https://api.github.com/repos/aurelia/templating-router/issues/4","number":4,"state":"open","locked":false,"title":"feat(route-href): add custom attribute for generating hrefs for named routes","user":{"login":"bryanrsmith","id":186704,"avatar_url":"https://avatars.githubusercontent.com/u/186704?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanrsmith","html_url":"https://github.com/bryanrsmith","followers_url":"https://api.github.com/users/bryanrsmith/followers","following_url":"https://api.github.com/users/bryanrsmith/following{/other_user}","gists_url":"https://api.github.com/users/bryanrsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanrsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanrsmith/subscriptions","organizations_url":"https://api.github.com/users/bryanrsmith/orgs","repos_url":"https://api.github.com/users/bryanrsmith/repos","events_url":"https://api.github.com/users/bryanrsmith/events{/privacy}","received_events_url":"https://api.github.com/users/bryanrsmith/received_events","type":"User","site_admin":false},"body":"fixes aurelia/router#4\r\n\r\nDepends on aurelia/router#67\r\n\r\nFeedback welcome!","created_at":"2015-04-19T00:59:00Z","updated_at":"2015-04-21T19:54:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d075153087185a299d47d270473e9110e4cd01f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aurelia/templating-router/pulls/4/commits","review_comments_url":"https://api.github.com/repos/aurelia/templating-router/pulls/4/comments","review_comment_url":"https://api.github.com/repos/aurelia/templating-router/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aurelia/templating-router/issues/4/comments","statuses_url":"https://api.github.com/repos/aurelia/templating-router/statuses/5c43ab08778c8578bd704c831ee114adb73a133c","head":{"label":"bryanrsmith:route-href","ref":"route-href","sha":"5c43ab08778c8578bd704c831ee114adb73a133c","user":{"login":"bryanrsmith","id":186704,"avatar_url":"https://avatars.githubusercontent.com/u/186704?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanrsmith","html_url":"https://github.com/bryanrsmith","followers_url":"https://api.github.com/users/bryanrsmith/followers","following_url":"https://api.github.com/users/bryanrsmith/following{/other_user}","gists_url":"https://api.github.com/users/bryanrsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanrsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanrsmith/subscriptions","organizations_url":"https://api.github.com/users/bryanrsmith/orgs","repos_url":"https://api.github.com/users/bryanrsmith/repos","events_url":"https://api.github.com/users/bryanrsmith/events{/privacy}","received_events_url":"https://api.github.com/users/bryanrsmith/received_events","type":"User","site_admin":false},"repo":{"id":34188104,"name":"templating-router","full_name":"bryanrsmith/templating-router","owner":{"login":"bryanrsmith","id":186704,"avatar_url":"https://avatars.githubusercontent.com/u/186704?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanrsmith","html_url":"https://github.com/bryanrsmith","followers_url":"https://api.github.com/users/bryanrsmith/followers","following_url":"https://api.github.com/users/bryanrsmith/following{/other_user}","gists_url":"https://api.github.com/users/bryanrsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanrsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanrsmith/subscriptions","organizations_url":"https://api.github.com/users/bryanrsmith/orgs","repos_url":"https://api.github.com/users/bryanrsmith/repos","events_url":"https://api.github.com/users/bryanrsmith/events{/privacy}","received_events_url":"https://api.github.com/users/bryanrsmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bryanrsmith/templating-router","description":"An implementation of the RouteLoader interface for use with the router module. Also contains a custom element that allows the templating engine to display the current route.","fork":true,"url":"https://api.github.com/repos/bryanrsmith/templating-router","forks_url":"https://api.github.com/repos/bryanrsmith/templating-router/forks","keys_url":"https://api.github.com/repos/bryanrsmith/templating-router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bryanrsmith/templating-router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bryanrsmith/templating-router/teams","hooks_url":"https://api.github.com/repos/bryanrsmith/templating-router/hooks","issue_events_url":"https://api.github.com/repos/bryanrsmith/templating-router/issues/events{/number}","events_url":"https://api.github.com/repos/bryanrsmith/templating-router/events","assignees_url":"https://api.github.com/repos/bryanrsmith/templating-router/assignees{/user}","branches_url":"https://api.github.com/repos/bryanrsmith/templating-router/branches{/branch}","tags_url":"https://api.github.com/repos/bryanrsmith/templating-router/tags","blobs_url":"https://api.github.com/repos/bryanrsmith/templating-router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bryanrsmith/templating-router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bryanrsmith/templating-router/git/refs{/sha}","trees_url":"https://api.github.com/repos/bryanrsmith/templating-router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bryanrsmith/templating-router/statuses/{sha}","languages_url":"https://api.github.com/repos/bryanrsmith/templating-router/languages","stargazers_url":"https://api.github.com/repos/bryanrsmith/templating-router/stargazers","contributors_url":"https://api.github.com/repos/bryanrsmith/templating-router/contributors","subscribers_url":"https://api.github.com/repos/bryanrsmith/templating-router/subscribers","subscription_url":"https://api.github.com/repos/bryanrsmith/templating-router/subscription","commits_url":"https://api.github.com/repos/bryanrsmith/templating-router/commits{/sha}","git_commits_url":"https://api.github.com/repos/bryanrsmith/templating-router/git/commits{/sha}","comments_url":"https://api.github.com/repos/bryanrsmith/templating-router/comments{/number}","issue_comment_url":"https://api.github.com/repos/bryanrsmith/templating-router/issues/comments{/number}","contents_url":"https://api.github.com/repos/bryanrsmith/templating-router/contents/{+path}","compare_url":"https://api.github.com/repos/bryanrsmith/templating-router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bryanrsmith/templating-router/merges","archive_url":"https://api.github.com/repos/bryanrsmith/templating-router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bryanrsmith/templating-router/downloads","issues_url":"https://api.github.com/repos/bryanrsmith/templating-router/issues{/number}","pulls_url":"https://api.github.com/repos/bryanrsmith/templating-router/pulls{/number}","milestones_url":"https://api.github.com/repos/bryanrsmith/templating-router/milestones{/number}","notifications_url":"https://api.github.com/repos/bryanrsmith/templating-router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bryanrsmith/templating-router/labels{/name}","releases_url":"https://api.github.com/repos/bryanrsmith/templating-router/releases{/id}","created_at":"2015-04-19T00:32:35Z","updated_at":"2015-04-19T00:32:35Z","pushed_at":"2015-04-19T00:52:53Z","git_url":"git://github.com/bryanrsmith/templating-router.git","ssh_url":"git@github.com:bryanrsmith/templating-router.git","clone_url":"https://github.com/bryanrsmith/templating-router.git","svn_url":"https://github.com/bryanrsmith/templating-router","homepage":null,"size":160,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aurelia:master","ref":"master","sha":"1dd6686be491a5dacfe0870b67ede9806b4c0995","user":{"login":"aurelia","id":9808864,"avatar_url":"https://avatars.githubusercontent.com/u/9808864?v=3","gravatar_id":"","url":"https://api.github.com/users/aurelia","html_url":"https://github.com/aurelia","followers_url":"https://api.github.com/users/aurelia/followers","following_url":"https://api.github.com/users/aurelia/following{/other_user}","gists_url":"https://api.github.com/users/aurelia/gists{/gist_id}","starred_url":"https://api.github.com/users/aurelia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aurelia/subscriptions","organizations_url":"https://api.github.com/users/aurelia/orgs","repos_url":"https://api.github.com/users/aurelia/repos","events_url":"https://api.github.com/users/aurelia/events{/privacy}","received_events_url":"https://api.github.com/users/aurelia/received_events","type":"Organization","site_admin":false},"repo":{"id":27830358,"name":"templating-router","full_name":"aurelia/templating-router","owner":{"login":"aurelia","id":9808864,"avatar_url":"https://avatars.githubusercontent.com/u/9808864?v=3","gravatar_id":"","url":"https://api.github.com/users/aurelia","html_url":"https://github.com/aurelia","followers_url":"https://api.github.com/users/aurelia/followers","following_url":"https://api.github.com/users/aurelia/following{/other_user}","gists_url":"https://api.github.com/users/aurelia/gists{/gist_id}","starred_url":"https://api.github.com/users/aurelia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aurelia/subscriptions","organizations_url":"https://api.github.com/users/aurelia/orgs","repos_url":"https://api.github.com/users/aurelia/repos","events_url":"https://api.github.com/users/aurelia/events{/privacy}","received_events_url":"https://api.github.com/users/aurelia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aurelia/templating-router","description":"An implementation of the RouteLoader interface for use with the router module. Also contains a custom element that allows the templating engine to display the current route.","fork":false,"url":"https://api.github.com/repos/aurelia/templating-router","forks_url":"https://api.github.com/repos/aurelia/templating-router/forks","keys_url":"https://api.github.com/repos/aurelia/templating-router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aurelia/templating-router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aurelia/templating-router/teams","hooks_url":"https://api.github.com/repos/aurelia/templating-router/hooks","issue_events_url":"https://api.github.com/repos/aurelia/templating-router/issues/events{/number}","events_url":"https://api.github.com/repos/aurelia/templating-router/events","assignees_url":"https://api.github.com/repos/aurelia/templating-router/assignees{/user}","branches_url":"https://api.github.com/repos/aurelia/templating-router/branches{/branch}","tags_url":"https://api.github.com/repos/aurelia/templating-router/tags","blobs_url":"https://api.github.com/repos/aurelia/templating-router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aurelia/templating-router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aurelia/templating-router/git/refs{/sha}","trees_url":"https://api.github.com/repos/aurelia/templating-router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aurelia/templating-router/statuses/{sha}","languages_url":"https://api.github.com/repos/aurelia/templating-router/languages","stargazers_url":"https://api.github.com/repos/aurelia/templating-router/stargazers","contributors_url":"https://api.github.com/repos/aurelia/templating-router/contributors","subscribers_url":"https://api.github.com/repos/aurelia/templating-router/subscribers","subscription_url":"https://api.github.com/repos/aurelia/templating-router/subscription","commits_url":"https://api.github.com/repos/aurelia/templating-router/commits{/sha}","git_commits_url":"https://api.github.com/repos/aurelia/templating-router/git/commits{/sha}","comments_url":"https://api.github.com/repos/aurelia/templating-router/comments{/number}","issue_comment_url":"https://api.github.com/repos/aurelia/templating-router/issues/comments{/number}","contents_url":"https://api.github.com/repos/aurelia/templating-router/contents/{+path}","compare_url":"https://api.github.com/repos/aurelia/templating-router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aurelia/templating-router/merges","archive_url":"https://api.github.com/repos/aurelia/templating-router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aurelia/templating-router/downloads","issues_url":"https://api.github.com/repos/aurelia/templating-router/issues{/number}","pulls_url":"https://api.github.com/repos/aurelia/templating-router/pulls{/number}","milestones_url":"https://api.github.com/repos/aurelia/templating-router/milestones{/number}","notifications_url":"https://api.github.com/repos/aurelia/templating-router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aurelia/templating-router/labels{/name}","releases_url":"https://api.github.com/repos/aurelia/templating-router/releases{/id}","created_at":"2014-12-10T17:10:05Z","updated_at":"2015-04-17T19:40:24Z","pushed_at":"2015-04-19T00:59:00Z","git_url":"git://github.com/aurelia/templating-router.git","ssh_url":"git@github.com:aurelia/templating-router.git","clone_url":"https://github.com/aurelia/templating-router.git","svn_url":"https://github.com/aurelia/templating-router","homepage":null,"size":518,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aurelia/templating-router/pulls/4"},"html":{"href":"https://github.com/aurelia/templating-router/pull/4"},"issue":{"href":"https://api.github.com/repos/aurelia/templating-router/issues/4"},"comments":{"href":"https://api.github.com/repos/aurelia/templating-router/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/aurelia/templating-router/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/aurelia/templating-router/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aurelia/templating-router/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/aurelia/templating-router/statuses/5c43ab08778c8578bd704c831ee114adb73a133c"}}}}