{"action":"created","issue":{"url":"https://api.github.com/repos/sencha/extjs-reactor/issues/26","repository_url":"https://api.github.com/repos/sencha/extjs-reactor","labels_url":"https://api.github.com/repos/sencha/extjs-reactor/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/sencha/extjs-reactor/issues/26/comments","events_url":"https://api.github.com/repos/sencha/extjs-reactor/issues/26/events","html_url":"https://github.com/sencha/extjs-reactor/issues/26","id":193186128,"number":26,"title":"Simplify to reactify(target)","user":{"login":"unional","id":3254987,"avatar_url":"https://avatars.githubusercontent.com/u/3254987?v=3","gravatar_id":"","url":"https://api.github.com/users/unional","html_url":"https://github.com/unional","followers_url":"https://api.github.com/users/unional/followers","following_url":"https://api.github.com/users/unional/following{/other_user}","gists_url":"https://api.github.com/users/unional/gists{/gist_id}","starred_url":"https://api.github.com/users/unional/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unional/subscriptions","organizations_url":"https://api.github.com/users/unional/orgs","repos_url":"https://api.github.com/users/unional/repos","events_url":"https://api.github.com/users/unional/events{/privacy}","received_events_url":"https://api.github.com/users/unional/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-02T18:34:03Z","updated_at":"2016-12-02T18:44:35Z","closed_at":null,"body":"From https://github.com/sencha/extjs-reactor/issues/12#issuecomment-264384809\r\n\r\nI don't like `reactify(...targets)`. I would suggest to keep it simple and do `reactify(target)`.\r\n\r\nThe consumer does not gain much from doing this \"shortcut\". It is better to keep it simple. Also, `reactify(...targets)` makes it hard to type and use in TypeScript in the future,when `react` `Property` and `State` can pass down to ExtJS component. \r\nIt also makes the code impossible to use generics.\r\n\r\n```ts\r\nimport React = require('react')  // You should do this too, CommonJS <-> ESM interop is flawed.\r\nimport { reactify } from '@extjs/reactor'\r\n\r\ninterface GridProperty {}\r\ninterface GridState {}\r\ninterface GridInterface { }\r\ninterface PanelProperty {}\r\ninterface PanelState {}\r\ninterface PanelInterface { }\r\n\r\nconst Grid1 = reactify('grid') as GridInterface & React.Component<GridProperty, GridState>\r\n\r\nconst [ Grid2, Panel ] = reactify('grid', 'panel') as [\r\n  GridInterface & React.Component<GridProperty, GridState>,\r\n  PanelInterface & React.Component<PanelProperty, PanelState>\r\n]\r\n\r\n// If using generic, which is what I'm doing:\r\nconst Grid3 = reactify<GridInterface, GridProperty, GridState>('grid')\r\n```\r\n\r\nI'm using Intersection type `GridInterface & React.Component<...>` because this would allow the consumer to extend the default grid and provide their own property and state.\r\n"},"comment":{"url":"https://api.github.com/repos/sencha/extjs-reactor/issues/comments/264530178","html_url":"https://github.com/sencha/extjs-reactor/issues/26#issuecomment-264530178","issue_url":"https://api.github.com/repos/sencha/extjs-reactor/issues/26","id":264530178,"user":{"login":"unional","id":3254987,"avatar_url":"https://avatars.githubusercontent.com/u/3254987?v=3","gravatar_id":"","url":"https://api.github.com/users/unional","html_url":"https://github.com/unional","followers_url":"https://api.github.com/users/unional/followers","following_url":"https://api.github.com/users/unional/following{/other_user}","gists_url":"https://api.github.com/users/unional/gists{/gist_id}","starred_url":"https://api.github.com/users/unional/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unional/subscriptions","organizations_url":"https://api.github.com/users/unional/orgs","repos_url":"https://api.github.com/users/unional/repos","events_url":"https://api.github.com/users/unional/events{/privacy}","received_events_url":"https://api.github.com/users/unional/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T18:44:35Z","updated_at":"2016-12-02T18:44:35Z","body":"So it will ends up with `any`:\r\n```ts\r\nfunction reactify(...targets: (string | Function)[]): any;\r\n```\r\n"}}
{"actor":{"display_login":"unional"}}