{"action":"opened","issue":{"url":"https://api.github.com/repos/inversify/InversifyJS/issues/425","repository_url":"https://api.github.com/repos/inversify/InversifyJS","labels_url":"https://api.github.com/repos/inversify/InversifyJS/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/inversify/InversifyJS/issues/425/comments","events_url":"https://api.github.com/repos/inversify/InversifyJS/issues/425/events","html_url":"https://github.com/inversify/InversifyJS/issues/425","id":192298869,"number":425,"title":"Proposal: ability to use numbers in `whenTargetNamed` and numbers/symbols as key in `whenTargetTagged`","user":{"login":"sanex3339","id":9210534,"avatar_url":"https://avatars.githubusercontent.com/u/9210534?v=3","gravatar_id":"","url":"https://api.github.com/users/sanex3339","html_url":"https://github.com/sanex3339","followers_url":"https://api.github.com/users/sanex3339/followers","following_url":"https://api.github.com/users/sanex3339/following{/other_user}","gists_url":"https://api.github.com/users/sanex3339/gists{/gist_id}","starred_url":"https://api.github.com/users/sanex3339/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanex3339/subscriptions","organizations_url":"https://api.github.com/users/sanex3339/orgs","repos_url":"https://api.github.com/users/sanex3339/repos","events_url":"https://api.github.com/users/sanex3339/events{/privacy}","received_events_url":"https://api.github.com/users/sanex3339/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-29T14:39:45Z","updated_at":"2016-11-29T14:39:45Z","closed_at":null,"body":"It would be nice if you will add ability to use enums in `whenTargetNamed` and enums/symbols as key in `whenTargetTagged`\r\n\r\nI want to use enums as names. But current signature of this method allows only `string` values, so i can't use enums.\r\n\r\n```\r\nenum NodeTransformers {\r\n    CatchClauseObfuscator,\r\n    FunctionDeclarationObfuscator,\r\n    FunctionObfuscator\r\n}\r\n\r\nbind<INodeTransformer>(ServiceIdentifiers.INodeTransformer)\r\n    .to(CatchClauseObfuscator)\r\n    .whenTargetNamed(NodeTransformers.CatchClauseObfuscator);\r\n\r\nbind<INodeTransformer>(ServiceIdentifiers.INodeTransformer)\r\n    .to(FunctionDeclarationObfuscator)\r\n    .whenTargetNamed(NodeTransformers.FunctionDeclarationObfuscator);\r\n\r\nbind<INodeTransformer>(ServiceIdentifiers.INodeTransformer)\r\n    .to(FunctionObfuscator)\r\n    .whenTargetNamed(NodeTransformers.FunctionObfuscator);\r\n```\r\n\r\nSame with `whenTargetTagged`. It would be nice to use as key `numbers` or `symbols`:\r\n```\r\nconst tag: symbol = Symbol();\r\n\r\nenum NodeTransformers {\r\n    CatchClauseObfuscator,\r\n    FunctionDeclarationObfuscator,\r\n    FunctionObfuscator\r\n}\r\n\r\nbind<INodeTransformer>(ServiceIdentifiers.INodeTransformer)\r\n    .to(CatchClauseObfuscator)\r\n    .whenTargetTagged(tag, NodeTransformers.CatchClauseObfuscator);\r\n\r\nbind<INodeTransformer>(ServiceIdentifiers.INodeTransformer)\r\n    .to(FunctionDeclarationObfuscator)\r\n    .whenTargetTagged(tag, NodeTransformers.FunctionDeclarationObfuscator);\r\n\r\nbind<INodeTransformer>(ServiceIdentifiers.INodeTransformer)\r\n    .to(FunctionObfuscator)\r\n    .whenTargetTagged(tag, NodeTransformers.FunctionObfuscator);\r\n```"}}
{"actor":{"display_login":"sanex3339"}}