{"action":"created","comment":{"url":"https://api.github.com/repos/aurelia/dependency-injection/pulls/comments/81731928","pull_request_review_id":2689203,"id":81731928,"diff_hunk":"@@ -299,8 +303,8 @@ export class NewInstance {\n   * @param key The key to resolve/instantiate.\n   * @return Returns an instance of NewInstance for the key.\n   */\n-  static of(key) {\n-    return new NewInstance(key);\n+  static of(key, ...dynamicDependencies: any[]) {","path":"src/resolvers.js","position":38,"original_position":30,"commit_id":"55dc17e0d9b3fa567c1147f6a4890a53971e2979","original_commit_id":"a3ee3994711fd8627f11d223ea32f397919d2397","user":{"login":"heruan","id":851745,"avatar_url":"https://avatars.githubusercontent.com/u/851745?v=3","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"body":"Done. Also added a docblock to the constructor like the other resolvers!","created_at":"2016-10-04T10:59:02Z","updated_at":"2016-10-04T10:59:02Z","html_url":"https://github.com/aurelia/dependency-injection/pull/110#discussion_r81731928","pull_request_url":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/aurelia/dependency-injection/pulls/comments/81731928"},"html":{"href":"https://github.com/aurelia/dependency-injection/pull/110#discussion_r81731928"},"pull_request":{"href":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110","id":76931476,"html_url":"https://github.com/aurelia/dependency-injection/pull/110","diff_url":"https://github.com/aurelia/dependency-injection/pull/110.diff","patch_url":"https://github.com/aurelia/dependency-injection/pull/110.patch","issue_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/110","number":110,"state":"open","locked":false,"title":"feat(resolvers): let NewInstance have resolved dynamic dependencies","user":{"login":"heruan","id":851745,"avatar_url":"https://avatars.githubusercontent.com/u/851745?v=3","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"body":"When using `NewInstance` resolver I'm often facing the need to have difference instances invoked with different dynamics dependencies, and so I fallback to `Factory` which needs an explicit call to get the dependency instance.\r\n\r\nThis PR allows `NewInstance` to have a list of dynamic dependencies which can be container's key or resolvers, for example:\r\n\r\n```javascript\r\nclass Logger {\r\n  constructor(dep1, dep2?) {\r\n  }\r\n}\r\n\r\n@inject(NewInstance.of(Logger, Dep1, Optional.of(Dep2))\r\nclass App {\r\n  constructor(logger) {\r\n  }\r\n}\r\n```\r\n\r\nThis is needed when `Logger` may accept different types for its dependencies and those couldn't be determined in `Logger` itself.","created_at":"2016-07-11T10:30:23Z","updated_at":"2016-10-04T10:59:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6b57c080b8f502e161bca35d3e398320237a431","assignee":{"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},"assignees":[{"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}],"milestone":null,"commits_url":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110/commits","review_comments_url":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110/comments","review_comment_url":"https://api.github.com/repos/aurelia/dependency-injection/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/110/comments","statuses_url":"https://api.github.com/repos/aurelia/dependency-injection/statuses/55dc17e0d9b3fa567c1147f6a4890a53971e2979","head":{"label":"heruan:new-instance-dyn","ref":"new-instance-dyn","sha":"55dc17e0d9b3fa567c1147f6a4890a53971e2979","user":{"login":"heruan","id":851745,"avatar_url":"https://avatars.githubusercontent.com/u/851745?v=3","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"repo":{"id":55705698,"name":"dependency-injection","full_name":"heruan/dependency-injection","owner":{"login":"heruan","id":851745,"avatar_url":"https://avatars.githubusercontent.com/u/851745?v=3","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/heruan/dependency-injection","description":"A lightweight,  extensible dependency injection container for JavaScript.","fork":true,"url":"https://api.github.com/repos/heruan/dependency-injection","forks_url":"https://api.github.com/repos/heruan/dependency-injection/forks","keys_url":"https://api.github.com/repos/heruan/dependency-injection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heruan/dependency-injection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heruan/dependency-injection/teams","hooks_url":"https://api.github.com/repos/heruan/dependency-injection/hooks","issue_events_url":"https://api.github.com/repos/heruan/dependency-injection/issues/events{/number}","events_url":"https://api.github.com/repos/heruan/dependency-injection/events","assignees_url":"https://api.github.com/repos/heruan/dependency-injection/assignees{/user}","branches_url":"https://api.github.com/repos/heruan/dependency-injection/branches{/branch}","tags_url":"https://api.github.com/repos/heruan/dependency-injection/tags","blobs_url":"https://api.github.com/repos/heruan/dependency-injection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heruan/dependency-injection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heruan/dependency-injection/git/refs{/sha}","trees_url":"https://api.github.com/repos/heruan/dependency-injection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heruan/dependency-injection/statuses/{sha}","languages_url":"https://api.github.com/repos/heruan/dependency-injection/languages","stargazers_url":"https://api.github.com/repos/heruan/dependency-injection/stargazers","contributors_url":"https://api.github.com/repos/heruan/dependency-injection/contributors","subscribers_url":"https://api.github.com/repos/heruan/dependency-injection/subscribers","subscription_url":"https://api.github.com/repos/heruan/dependency-injection/subscription","commits_url":"https://api.github.com/repos/heruan/dependency-injection/commits{/sha}","git_commits_url":"https://api.github.com/repos/heruan/dependency-injection/git/commits{/sha}","comments_url":"https://api.github.com/repos/heruan/dependency-injection/comments{/number}","issue_comment_url":"https://api.github.com/repos/heruan/dependency-injection/issues/comments{/number}","contents_url":"https://api.github.com/repos/heruan/dependency-injection/contents/{+path}","compare_url":"https://api.github.com/repos/heruan/dependency-injection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heruan/dependency-injection/merges","archive_url":"https://api.github.com/repos/heruan/dependency-injection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heruan/dependency-injection/downloads","issues_url":"https://api.github.com/repos/heruan/dependency-injection/issues{/number}","pulls_url":"https://api.github.com/repos/heruan/dependency-injection/pulls{/number}","milestones_url":"https://api.github.com/repos/heruan/dependency-injection/milestones{/number}","notifications_url":"https://api.github.com/repos/heruan/dependency-injection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heruan/dependency-injection/labels{/name}","releases_url":"https://api.github.com/repos/heruan/dependency-injection/releases{/id}","deployments_url":"https://api.github.com/repos/heruan/dependency-injection/deployments","created_at":"2016-04-07T15:24:37Z","updated_at":"2016-04-07T15:24:37Z","pushed_at":"2016-10-04T10:56:36Z","git_url":"git://github.com/heruan/dependency-injection.git","ssh_url":"git@github.com:heruan/dependency-injection.git","clone_url":"https://github.com/heruan/dependency-injection.git","svn_url":"https://github.com/heruan/dependency-injection","homepage":null,"size":699,"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":"5cbff53ddda9aa145360c325e7337d0a1d386508","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":27728611,"name":"dependency-injection","full_name":"aurelia/dependency-injection","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/dependency-injection","description":"A lightweight,  extensible dependency injection container for JavaScript.","fork":false,"url":"https://api.github.com/repos/aurelia/dependency-injection","forks_url":"https://api.github.com/repos/aurelia/dependency-injection/forks","keys_url":"https://api.github.com/repos/aurelia/dependency-injection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aurelia/dependency-injection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aurelia/dependency-injection/teams","hooks_url":"https://api.github.com/repos/aurelia/dependency-injection/hooks","issue_events_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/events{/number}","events_url":"https://api.github.com/repos/aurelia/dependency-injection/events","assignees_url":"https://api.github.com/repos/aurelia/dependency-injection/assignees{/user}","branches_url":"https://api.github.com/repos/aurelia/dependency-injection/branches{/branch}","tags_url":"https://api.github.com/repos/aurelia/dependency-injection/tags","blobs_url":"https://api.github.com/repos/aurelia/dependency-injection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aurelia/dependency-injection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aurelia/dependency-injection/git/refs{/sha}","trees_url":"https://api.github.com/repos/aurelia/dependency-injection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aurelia/dependency-injection/statuses/{sha}","languages_url":"https://api.github.com/repos/aurelia/dependency-injection/languages","stargazers_url":"https://api.github.com/repos/aurelia/dependency-injection/stargazers","contributors_url":"https://api.github.com/repos/aurelia/dependency-injection/contributors","subscribers_url":"https://api.github.com/repos/aurelia/dependency-injection/subscribers","subscription_url":"https://api.github.com/repos/aurelia/dependency-injection/subscription","commits_url":"https://api.github.com/repos/aurelia/dependency-injection/commits{/sha}","git_commits_url":"https://api.github.com/repos/aurelia/dependency-injection/git/commits{/sha}","comments_url":"https://api.github.com/repos/aurelia/dependency-injection/comments{/number}","issue_comment_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/comments{/number}","contents_url":"https://api.github.com/repos/aurelia/dependency-injection/contents/{+path}","compare_url":"https://api.github.com/repos/aurelia/dependency-injection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aurelia/dependency-injection/merges","archive_url":"https://api.github.com/repos/aurelia/dependency-injection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aurelia/dependency-injection/downloads","issues_url":"https://api.github.com/repos/aurelia/dependency-injection/issues{/number}","pulls_url":"https://api.github.com/repos/aurelia/dependency-injection/pulls{/number}","milestones_url":"https://api.github.com/repos/aurelia/dependency-injection/milestones{/number}","notifications_url":"https://api.github.com/repos/aurelia/dependency-injection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aurelia/dependency-injection/labels{/name}","releases_url":"https://api.github.com/repos/aurelia/dependency-injection/releases{/id}","deployments_url":"https://api.github.com/repos/aurelia/dependency-injection/deployments","created_at":"2014-12-08T18:28:11Z","updated_at":"2016-10-03T23:07:02Z","pushed_at":"2016-10-04T10:56:37Z","git_url":"git://github.com/aurelia/dependency-injection.git","ssh_url":"git@github.com:aurelia/dependency-injection.git","clone_url":"https://github.com/aurelia/dependency-injection.git","svn_url":"https://github.com/aurelia/dependency-injection","homepage":null,"size":704,"stargazers_count":99,"watchers_count":99,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":4,"forks":52,"open_issues":4,"watchers":99,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110"},"html":{"href":"https://github.com/aurelia/dependency-injection/pull/110"},"issue":{"href":"https://api.github.com/repos/aurelia/dependency-injection/issues/110"},"comments":{"href":"https://api.github.com/repos/aurelia/dependency-injection/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/aurelia/dependency-injection/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aurelia/dependency-injection/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/aurelia/dependency-injection/statuses/55dc17e0d9b3fa567c1147f6a4890a53971e2979"}}}}
{"actor":{"display_login":"heruan"}}