{"action":"created","comment":{"url":"https://api.github.com/repos/jfhbrook/jambox/pulls/comments/52785944","id":52785944,"diff_hunk":"@@ -0,0 +1,52 @@\n+'use strict'\n+\n+let newOperator = require('new-operator')\n+\n+module.exports = class Dependency {\n+  constructor(dependency) {\n+    this._dependency = dependency\n+    this._init = []\n+    this._createWith = null\n+    this._constructWith = null\n+  }\n+\n+  callWith() {\n+    this._createWith = [].slice.call(arguments)\n+    return this\n+  }\n+\n+  constructWith() {\n+    this._constructWith = [].slice.call(arguments)\n+    return this\n+  }\n+\n+  init(initFn) {\n+    this._init.push(initFn)\n+    return this\n+  }\n+\n+  build() {\n+    return Promise.resolve().then(() => {\n+      let dependency = null\n+\n+      if (this._createWith && this._constructWith) {","path":"lib/dependency.js","position":32,"original_position":32,"commit_id":"0546f63238bd0dffa9d1d5b13cd49f5678fe1727","original_commit_id":"0546f63238bd0dffa9d1d5b13cd49f5678fe1727","user":{"login":"mattm458","id":918435,"avatar_url":"https://avatars.githubusercontent.com/u/918435?v=3","gravatar_id":"","url":"https://api.github.com/users/mattm458","html_url":"https://github.com/mattm458","followers_url":"https://api.github.com/users/mattm458/followers","following_url":"https://api.github.com/users/mattm458/following{/other_user}","gists_url":"https://api.github.com/users/mattm458/gists{/gist_id}","starred_url":"https://api.github.com/users/mattm458/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattm458/subscriptions","organizations_url":"https://api.github.com/users/mattm458/orgs","repos_url":"https://api.github.com/users/mattm458/repos","events_url":"https://api.github.com/users/mattm458/events{/privacy}","received_events_url":"https://api.github.com/users/mattm458/received_events","type":"User","site_admin":false},"body":"I think if you are going to draw a distinction between instance-based services and closure-based services (it took me a while to get what was going on but now that I get it I think it's a super cool idea), I would make that distinction waaay back up at the top of the builder rather than here. Like have an `InstanceDependency` builder and a `ClosureDependency` builder, each with its own particular functionality.\r\n\r\nPart of the reason I'd push for that is that if you trigger this error now, it's pretty late in the assembly process to have found out. On the other hand, if you can't even call `callWith()` because you asked for an `InstanceDependency` and it doesn't have that function, it's more clear what happened.","created_at":"2016-02-12T19:23:22Z","updated_at":"2016-02-12T19:23:22Z","html_url":"https://github.com/jfhbrook/jambox/pull/1#discussion_r52785944","pull_request_url":"https://api.github.com/repos/jfhbrook/jambox/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jfhbrook/jambox/pulls/comments/52785944"},"html":{"href":"https://github.com/jfhbrook/jambox/pull/1#discussion_r52785944"},"pull_request":{"href":"https://api.github.com/repos/jfhbrook/jambox/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jfhbrook/jambox/pulls/1","id":59210657,"html_url":"https://github.com/jfhbrook/jambox/pull/1","diff_url":"https://github.com/jfhbrook/jambox/pull/1.diff","patch_url":"https://github.com/jfhbrook/jambox/pull/1.patch","issue_url":"https://api.github.com/repos/jfhbrook/jambox/issues/1","number":1,"state":"open","locked":false,"title":"Dependency builder","user":{"login":"jfhbrook","id":57536,"avatar_url":"https://avatars.githubusercontent.com/u/57536?v=3","gravatar_id":"","url":"https://api.github.com/users/jfhbrook","html_url":"https://github.com/jfhbrook","followers_url":"https://api.github.com/users/jfhbrook/followers","following_url":"https://api.github.com/users/jfhbrook/following{/other_user}","gists_url":"https://api.github.com/users/jfhbrook/gists{/gist_id}","starred_url":"https://api.github.com/users/jfhbrook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfhbrook/subscriptions","organizations_url":"https://api.github.com/users/jfhbrook/orgs","repos_url":"https://api.github.com/users/jfhbrook/repos","events_url":"https://api.github.com/users/jfhbrook/events{/privacy}","received_events_url":"https://api.github.com/users/jfhbrook/received_events","type":"User","site_admin":false},"body":"In order to make services more general, I ripped out the jambox-centric resolution stuff and put a small dependency builder in its place. Next steps include adding some sense of automated dependency resolution, perhaps by detecting arguments that are instanceof Dependency?","created_at":"2016-02-12T18:18:33Z","updated_at":"2016-02-12T19:23:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddd18bff9d7066008f5ba4271f62dee13be64b63","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jfhbrook/jambox/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jfhbrook/jambox/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jfhbrook/jambox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jfhbrook/jambox/issues/1/comments","statuses_url":"https://api.github.com/repos/jfhbrook/jambox/statuses/0546f63238bd0dffa9d1d5b13cd49f5678fe1727","head":{"label":"jfhbrook:builder","ref":"builder","sha":"0546f63238bd0dffa9d1d5b13cd49f5678fe1727","user":{"login":"jfhbrook","id":57536,"avatar_url":"https://avatars.githubusercontent.com/u/57536?v=3","gravatar_id":"","url":"https://api.github.com/users/jfhbrook","html_url":"https://github.com/jfhbrook","followers_url":"https://api.github.com/users/jfhbrook/followers","following_url":"https://api.github.com/users/jfhbrook/following{/other_user}","gists_url":"https://api.github.com/users/jfhbrook/gists{/gist_id}","starred_url":"https://api.github.com/users/jfhbrook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfhbrook/subscriptions","organizations_url":"https://api.github.com/users/jfhbrook/orgs","repos_url":"https://api.github.com/users/jfhbrook/repos","events_url":"https://api.github.com/users/jfhbrook/events{/privacy}","received_events_url":"https://api.github.com/users/jfhbrook/received_events","type":"User","site_admin":false},"repo":{"id":51047268,"name":"jambox","full_name":"jfhbrook/jambox","owner":{"login":"jfhbrook","id":57536,"avatar_url":"https://avatars.githubusercontent.com/u/57536?v=3","gravatar_id":"","url":"https://api.github.com/users/jfhbrook","html_url":"https://github.com/jfhbrook","followers_url":"https://api.github.com/users/jfhbrook/followers","following_url":"https://api.github.com/users/jfhbrook/following{/other_user}","gists_url":"https://api.github.com/users/jfhbrook/gists{/gist_id}","starred_url":"https://api.github.com/users/jfhbrook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfhbrook/subscriptions","organizations_url":"https://api.github.com/users/jfhbrook/orgs","repos_url":"https://api.github.com/users/jfhbrook/repos","events_url":"https://api.github.com/users/jfhbrook/events{/privacy}","received_events_url":"https://api.github.com/users/jfhbrook/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jfhbrook/jambox","description":"DI test bed","fork":false,"url":"https://api.github.com/repos/jfhbrook/jambox","forks_url":"https://api.github.com/repos/jfhbrook/jambox/forks","keys_url":"https://api.github.com/repos/jfhbrook/jambox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jfhbrook/jambox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jfhbrook/jambox/teams","hooks_url":"https://api.github.com/repos/jfhbrook/jambox/hooks","issue_events_url":"https://api.github.com/repos/jfhbrook/jambox/issues/events{/number}","events_url":"https://api.github.com/repos/jfhbrook/jambox/events","assignees_url":"https://api.github.com/repos/jfhbrook/jambox/assignees{/user}","branches_url":"https://api.github.com/repos/jfhbrook/jambox/branches{/branch}","tags_url":"https://api.github.com/repos/jfhbrook/jambox/tags","blobs_url":"https://api.github.com/repos/jfhbrook/jambox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jfhbrook/jambox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jfhbrook/jambox/git/refs{/sha}","trees_url":"https://api.github.com/repos/jfhbrook/jambox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jfhbrook/jambox/statuses/{sha}","languages_url":"https://api.github.com/repos/jfhbrook/jambox/languages","stargazers_url":"https://api.github.com/repos/jfhbrook/jambox/stargazers","contributors_url":"https://api.github.com/repos/jfhbrook/jambox/contributors","subscribers_url":"https://api.github.com/repos/jfhbrook/jambox/subscribers","subscription_url":"https://api.github.com/repos/jfhbrook/jambox/subscription","commits_url":"https://api.github.com/repos/jfhbrook/jambox/commits{/sha}","git_commits_url":"https://api.github.com/repos/jfhbrook/jambox/git/commits{/sha}","comments_url":"https://api.github.com/repos/jfhbrook/jambox/comments{/number}","issue_comment_url":"https://api.github.com/repos/jfhbrook/jambox/issues/comments{/number}","contents_url":"https://api.github.com/repos/jfhbrook/jambox/contents/{+path}","compare_url":"https://api.github.com/repos/jfhbrook/jambox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jfhbrook/jambox/merges","archive_url":"https://api.github.com/repos/jfhbrook/jambox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jfhbrook/jambox/downloads","issues_url":"https://api.github.com/repos/jfhbrook/jambox/issues{/number}","pulls_url":"https://api.github.com/repos/jfhbrook/jambox/pulls{/number}","milestones_url":"https://api.github.com/repos/jfhbrook/jambox/milestones{/number}","notifications_url":"https://api.github.com/repos/jfhbrook/jambox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jfhbrook/jambox/labels{/name}","releases_url":"https://api.github.com/repos/jfhbrook/jambox/releases{/id}","deployments_url":"https://api.github.com/repos/jfhbrook/jambox/deployments","created_at":"2016-02-04T02:40:38Z","updated_at":"2016-02-04T02:53:45Z","pushed_at":"2016-02-12T18:33:13Z","git_url":"git://github.com/jfhbrook/jambox.git","ssh_url":"git@github.com:jfhbrook/jambox.git","clone_url":"https://github.com/jfhbrook/jambox.git","svn_url":"https://github.com/jfhbrook/jambox","homepage":null,"size":11,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"jfhbrook:master","ref":"master","sha":"889e21a621b621e440abafff6aaae478650708ee","user":{"login":"jfhbrook","id":57536,"avatar_url":"https://avatars.githubusercontent.com/u/57536?v=3","gravatar_id":"","url":"https://api.github.com/users/jfhbrook","html_url":"https://github.com/jfhbrook","followers_url":"https://api.github.com/users/jfhbrook/followers","following_url":"https://api.github.com/users/jfhbrook/following{/other_user}","gists_url":"https://api.github.com/users/jfhbrook/gists{/gist_id}","starred_url":"https://api.github.com/users/jfhbrook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfhbrook/subscriptions","organizations_url":"https://api.github.com/users/jfhbrook/orgs","repos_url":"https://api.github.com/users/jfhbrook/repos","events_url":"https://api.github.com/users/jfhbrook/events{/privacy}","received_events_url":"https://api.github.com/users/jfhbrook/received_events","type":"User","site_admin":false},"repo":{"id":51047268,"name":"jambox","full_name":"jfhbrook/jambox","owner":{"login":"jfhbrook","id":57536,"avatar_url":"https://avatars.githubusercontent.com/u/57536?v=3","gravatar_id":"","url":"https://api.github.com/users/jfhbrook","html_url":"https://github.com/jfhbrook","followers_url":"https://api.github.com/users/jfhbrook/followers","following_url":"https://api.github.com/users/jfhbrook/following{/other_user}","gists_url":"https://api.github.com/users/jfhbrook/gists{/gist_id}","starred_url":"https://api.github.com/users/jfhbrook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfhbrook/subscriptions","organizations_url":"https://api.github.com/users/jfhbrook/orgs","repos_url":"https://api.github.com/users/jfhbrook/repos","events_url":"https://api.github.com/users/jfhbrook/events{/privacy}","received_events_url":"https://api.github.com/users/jfhbrook/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jfhbrook/jambox","description":"DI test bed","fork":false,"url":"https://api.github.com/repos/jfhbrook/jambox","forks_url":"https://api.github.com/repos/jfhbrook/jambox/forks","keys_url":"https://api.github.com/repos/jfhbrook/jambox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jfhbrook/jambox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jfhbrook/jambox/teams","hooks_url":"https://api.github.com/repos/jfhbrook/jambox/hooks","issue_events_url":"https://api.github.com/repos/jfhbrook/jambox/issues/events{/number}","events_url":"https://api.github.com/repos/jfhbrook/jambox/events","assignees_url":"https://api.github.com/repos/jfhbrook/jambox/assignees{/user}","branches_url":"https://api.github.com/repos/jfhbrook/jambox/branches{/branch}","tags_url":"https://api.github.com/repos/jfhbrook/jambox/tags","blobs_url":"https://api.github.com/repos/jfhbrook/jambox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jfhbrook/jambox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jfhbrook/jambox/git/refs{/sha}","trees_url":"https://api.github.com/repos/jfhbrook/jambox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jfhbrook/jambox/statuses/{sha}","languages_url":"https://api.github.com/repos/jfhbrook/jambox/languages","stargazers_url":"https://api.github.com/repos/jfhbrook/jambox/stargazers","contributors_url":"https://api.github.com/repos/jfhbrook/jambox/contributors","subscribers_url":"https://api.github.com/repos/jfhbrook/jambox/subscribers","subscription_url":"https://api.github.com/repos/jfhbrook/jambox/subscription","commits_url":"https://api.github.com/repos/jfhbrook/jambox/commits{/sha}","git_commits_url":"https://api.github.com/repos/jfhbrook/jambox/git/commits{/sha}","comments_url":"https://api.github.com/repos/jfhbrook/jambox/comments{/number}","issue_comment_url":"https://api.github.com/repos/jfhbrook/jambox/issues/comments{/number}","contents_url":"https://api.github.com/repos/jfhbrook/jambox/contents/{+path}","compare_url":"https://api.github.com/repos/jfhbrook/jambox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jfhbrook/jambox/merges","archive_url":"https://api.github.com/repos/jfhbrook/jambox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jfhbrook/jambox/downloads","issues_url":"https://api.github.com/repos/jfhbrook/jambox/issues{/number}","pulls_url":"https://api.github.com/repos/jfhbrook/jambox/pulls{/number}","milestones_url":"https://api.github.com/repos/jfhbrook/jambox/milestones{/number}","notifications_url":"https://api.github.com/repos/jfhbrook/jambox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jfhbrook/jambox/labels{/name}","releases_url":"https://api.github.com/repos/jfhbrook/jambox/releases{/id}","deployments_url":"https://api.github.com/repos/jfhbrook/jambox/deployments","created_at":"2016-02-04T02:40:38Z","updated_at":"2016-02-04T02:53:45Z","pushed_at":"2016-02-12T18:33:13Z","git_url":"git://github.com/jfhbrook/jambox.git","ssh_url":"git@github.com:jfhbrook/jambox.git","clone_url":"https://github.com/jfhbrook/jambox.git","svn_url":"https://github.com/jfhbrook/jambox","homepage":null,"size":11,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jfhbrook/jambox/pulls/1"},"html":{"href":"https://github.com/jfhbrook/jambox/pull/1"},"issue":{"href":"https://api.github.com/repos/jfhbrook/jambox/issues/1"},"comments":{"href":"https://api.github.com/repos/jfhbrook/jambox/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jfhbrook/jambox/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jfhbrook/jambox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jfhbrook/jambox/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jfhbrook/jambox/statuses/0546f63238bd0dffa9d1d5b13cd49f5678fe1727"}}}}