{"action":"created","issue":{"url":"https://api.github.com/repos/jeffijoe/awilix/issues/26","repository_url":"https://api.github.com/repos/jeffijoe/awilix","labels_url":"https://api.github.com/repos/jeffijoe/awilix/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/jeffijoe/awilix/issues/26/comments","events_url":"https://api.github.com/repos/jeffijoe/awilix/issues/26/events","html_url":"https://github.com/jeffijoe/awilix/issues/26","id":242104632,"number":26,"title":"Extract registration name from function and class","user":{"login":"mikhas-rock","id":332960,"avatar_url":"https://avatars1.githubusercontent.com/u/332960?v=3","gravatar_id":"","url":"https://api.github.com/users/mikhas-rock","html_url":"https://github.com/mikhas-rock","followers_url":"https://api.github.com/users/mikhas-rock/followers","following_url":"https://api.github.com/users/mikhas-rock/following{/other_user}","gists_url":"https://api.github.com/users/mikhas-rock/gists{/gist_id}","starred_url":"https://api.github.com/users/mikhas-rock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikhas-rock/subscriptions","organizations_url":"https://api.github.com/users/mikhas-rock/orgs","repos_url":"https://api.github.com/users/mikhas-rock/repos","events_url":"https://api.github.com/users/mikhas-rock/events{/privacy}","received_events_url":"https://api.github.com/users/mikhas-rock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-11T16:15:59Z","updated_at":"2017-07-11T16:30:20Z","closed_at":null,"body":"It would prevent typing the names twice in several occasions:\r\n\r\n```\r\nclass MyClass { /* ... */}\r\nfunction myFunction(MyClass){ /* ... */ }\r\n\r\n// AS IS\r\ncontainer.registerClass('MyClass', MyClass);\r\ncontainer.registerFunction('myFunction', myFunction);\r\n\r\n// SUGGESTION\r\ncontainer.registerClass(MyClass);\r\ncontainer.registerFunction(myFunction);\r\n\r\ncontainer.register(MyClass);\r\ncontainer.register(myFunction);"},"comment":{"url":"https://api.github.com/repos/jeffijoe/awilix/issues/comments/314499707","html_url":"https://github.com/jeffijoe/awilix/issues/26#issuecomment-314499707","issue_url":"https://api.github.com/repos/jeffijoe/awilix/issues/26","id":314499707,"user":{"login":"jeffijoe","id":2505474,"avatar_url":"https://avatars2.githubusercontent.com/u/2505474?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffijoe","html_url":"https://github.com/jeffijoe","followers_url":"https://api.github.com/users/jeffijoe/followers","following_url":"https://api.github.com/users/jeffijoe/following{/other_user}","gists_url":"https://api.github.com/users/jeffijoe/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffijoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffijoe/subscriptions","organizations_url":"https://api.github.com/users/jeffijoe/orgs","repos_url":"https://api.github.com/users/jeffijoe/repos","events_url":"https://api.github.com/users/jeffijoe/events{/privacy}","received_events_url":"https://api.github.com/users/jeffijoe/received_events","type":"User","site_admin":false},"created_at":"2017-07-11T16:30:20Z","updated_at":"2017-07-11T16:30:20Z","body":"I like the suggestion, but in case `.name` does not _actually_ return what you expect, you wouldn't know what it was registered as. For example:\r\n\r\n```js\r\nconst myFunction = function myAwesomeFunction () {}\r\n\r\ncontainer.registerFunction(myFunction)\r\n\r\ncontainer.resolve('myFunction') // boom\r\n```\r\n\r\nAdditionally, it can only work for `registerClass` and `registerFunction`, not `register` (because you don't register actual values with `register`, you use the `asClass`/`asFunction` chains)\r\n\r\nThoughts?"}}
{"actor":{"display_login":"jeffijoe"}}