{"action":"closed","issue":{"url":"https://api.github.com/repos/jasonslyvia/react-anything-sortable/issues/42","repository_url":"https://api.github.com/repos/jasonslyvia/react-anything-sortable","labels_url":"https://api.github.com/repos/jasonslyvia/react-anything-sortable/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/jasonslyvia/react-anything-sortable/issues/42/comments","events_url":"https://api.github.com/repos/jasonslyvia/react-anything-sortable/issues/42/events","html_url":"https://github.com/jasonslyvia/react-anything-sortable/issues/42","id":150820837,"number":42,"title":"Better named HOC export","user":{"login":"mdoelker","id":2145319,"avatar_url":"https://avatars.githubusercontent.com/u/2145319?v=3","gravatar_id":"","url":"https://api.github.com/users/mdoelker","html_url":"https://github.com/mdoelker","followers_url":"https://api.github.com/users/mdoelker/followers","following_url":"https://api.github.com/users/mdoelker/following{/other_user}","gists_url":"https://api.github.com/users/mdoelker/gists{/gist_id}","starred_url":"https://api.github.com/users/mdoelker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdoelker/subscriptions","organizations_url":"https://api.github.com/users/mdoelker/orgs","repos_url":"https://api.github.com/users/mdoelker/repos","events_url":"https://api.github.com/users/mdoelker/events{/privacy}","received_events_url":"https://api.github.com/users/mdoelker/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-04-25T10:49:51Z","updated_at":"2016-06-27T02:12:04Z","closed_at":"2016-06-27T02:12:04Z","body":"As I couldn't use mixins initially (see #41) I've been going down the HOC route. I don't use decorators though, so the naming of the export is a bit weird when you use it without them.\r\n\r\nI suggest adding another alias for the exported mixin/hoc component:\r\n```js\r\nSortable.SortableItemMixin = SortableItemMixin(); // Mixin style\r\nSortable.SortableItemFactory = SortableItemMixin; // HOC style\r\nSortable.sortable = SortableItemMixin; // Decorator HOC style\r\n```\r\n\r\nwhich enables a more natural usage without decorators, something like this:\r\n```js\r\nimport React from \"react\";\r\nimport Sortable, { SortableItemFactory } from \"react-anything-sortable\";\r\nimport Item from \"./item\";\r\n\r\nconst SortableItem = SortableItemFactory(Item);\r\n\r\nclass SortableExample extends React.Component {\r\n  _handleSort(data) {\r\n    console.log(data);\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <Sortable onSort={this._handleSort.bind(this)}>\r\n        <SortableItem className=\"item-1\" sortData=\"react\" key={1}>\r\n          React\r\n        </SortableItem>\r\n        <SortableItem className=\"item-2\" sortData=\"angular\" key={2}>\r\n          Angular\r\n        </SortableItem>\r\n        <SortableItem className=\"item-3\" sortData=\"backbone\" key={3}>\r\n          Backbone\r\n        </SortableItem>\r\n      </Sortable>\r\n    );\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"jasonslyvia"}}