{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/413","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/413/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/413/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/413/events","html_url":"https://github.com/lhorie/mithril.js/issues/413","id":54279887,"number":413,"title":"Reusable components.","user":{"login":"vivekimsit","id":1201766,"avatar_url":"https://avatars.githubusercontent.com/u/1201766?v=3","gravatar_id":"","url":"https://api.github.com/users/vivekimsit","html_url":"https://github.com/vivekimsit","followers_url":"https://api.github.com/users/vivekimsit/followers","following_url":"https://api.github.com/users/vivekimsit/following{/other_user}","gists_url":"https://api.github.com/users/vivekimsit/gists{/gist_id}","starred_url":"https://api.github.com/users/vivekimsit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivekimsit/subscriptions","organizations_url":"https://api.github.com/users/vivekimsit/orgs","repos_url":"https://api.github.com/users/vivekimsit/repos","events_url":"https://api.github.com/users/vivekimsit/events{/privacy}","received_events_url":"https://api.github.com/users/vivekimsit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lhorie/mithril.js/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":101,"created_at":"2015-01-14T03:25:08Z","updated_at":"2015-02-07T23:19:00Z","closed_at":null,"body":"Hi,\r\n\r\nWhat about creating a repo which contains a set of reusable UI components? something like [Angular-UI](https://angular-ui.github.io/) or [Khan Acacdemy](http://khan.github.io/react-components/)\r\n\r\nI am ready to contribute.\r\n\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/73388276","html_url":"https://github.com/lhorie/mithril.js/issues/413#issuecomment-73388276","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/413","id":73388276,"user":{"login":"nelsonmenezes","id":145197,"avatar_url":"https://avatars.githubusercontent.com/u/145197?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsonmenezes","html_url":"https://github.com/nelsonmenezes","followers_url":"https://api.github.com/users/nelsonmenezes/followers","following_url":"https://api.github.com/users/nelsonmenezes/following{/other_user}","gists_url":"https://api.github.com/users/nelsonmenezes/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonmenezes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonmenezes/subscriptions","organizations_url":"https://api.github.com/users/nelsonmenezes/orgs","repos_url":"https://api.github.com/users/nelsonmenezes/repos","events_url":"https://api.github.com/users/nelsonmenezes/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonmenezes/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T23:19:00Z","updated_at":"2015-02-07T23:19:00Z","body":"@barneycarroll, thanks for taking the time to reply. I agree that at this stage MVC is indeed a rabbit hole; I'm just trying to see if there is something to be gained by trying something closer to the original design (as I understand it).\r\n\r\nI realise my example wasn't very clear with regards to the controllers — as it is, the controllers simply return a map of event types and respective handlers. Optionally the handlers can be \"namespaced\" to a more specific jQuery-like delegation selector (that's how I implemented it in [my crappy test code](https://github.com/nelsonmenezes/jsmvc/blob/master/test.js#L38-L55)). This could be expanded to handle something more generic than just DOM events originating from within the root element of the view (e.g. swap out the model on route change).\r\n\r\nWhat does the code address? Good question!  :)  Primarily the ability to handle the hierarchical instantiation. If models are recognised as part of the module (and the \"module\" is an instance of an MVC triad) then I think it makes sense to place sub-modules within the model — the only stateful data contained in the modules (and sub-modules) is the model (and sub-models).\r\n\r\nAs for the event handling in controllers, I guess I was trying to stick to the \"ancient wisdom\" of the MVC pattern… this could be done in the view, as it is now, but I kind of liked the idea to keep the \"user control\" part of the module in the controller. I haven't thought it deeply through.\r\n\r\n(Aside: I am disliking more and more the word \"module\" to describe the instance-of-mvc-machinary concept. Not that I currently have a better suggestion. Triad?)"}}