{"action":"created","issue":{"url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/69","labels_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/69/comments","events_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/69/events","html_url":"https://github.com/crysalead-js/dom-layer/issues/69","id":125348513,"number":69,"title":"Sub-views?","user":{"login":"sprat","id":577183,"avatar_url":"https://avatars.githubusercontent.com/u/577183?v=3","gravatar_id":"","url":"https://api.github.com/users/sprat","html_url":"https://github.com/sprat","followers_url":"https://api.github.com/users/sprat/followers","following_url":"https://api.github.com/users/sprat/following{/other_user}","gists_url":"https://api.github.com/users/sprat/gists{/gist_id}","starred_url":"https://api.github.com/users/sprat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprat/subscriptions","organizations_url":"https://api.github.com/users/sprat/orgs","repos_url":"https://api.github.com/users/sprat/repos","events_url":"https://api.github.com/users/sprat/events{/privacy}","received_events_url":"https://api.github.com/users/sprat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-07T08:30:37Z","updated_at":"2016-01-08T05:39:13Z","closed_at":"2016-01-08T05:39:13Z","body":"I discovered this project recently and I quite like the API. However, there's something I would like to do and I can't find how to do it with the API.\r\n\r\nI would like to do something like this\r\n```javascript\r\nfunction main() {\r\n  return new Tag('section', {}, [\r\n    header,\r\n    content\r\n  ]\r\n}\r\n\r\nfunction header() {\r\n  return new Tag('header', {}, []);\r\n}\r\n\r\nfunction content() {\r\n  return [\r\n    new Tag('p', {}, []),\r\n    new Tag('p', {}, [])\r\n  ];\r\n}\r\n```\r\n\r\nBut `render` does not accept a list of functions as children, or a list with tags and functions: it only accepts a single function or a list of tags.\r\n\r\nIn my example, I guess you would just call the header and content function in main. But in the \"thing\" I would like to build, the header and content are more involved than that: they are callable View objects, with an API (e.g. event emitter, ...), and I would call them to render.\r\n\r\nI've seen in your \"input\" example that you use sub-views/sub-components. But due to the restriction I just talked about,  you are forced to wrap your view.render/component.render in a div, which is a bit annoying.\r\n\r\nIs there a way to do what I want to do with the existing API? Or can you please consider extending the API? I can't probably send a merge request if you want.\r\n"},"comment":{"url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/comments/169901595","html_url":"https://github.com/crysalead-js/dom-layer/issues/69#issuecomment-169901595","issue_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/69","id":169901595,"user":{"login":"sprat","id":577183,"avatar_url":"https://avatars.githubusercontent.com/u/577183?v=3","gravatar_id":"","url":"https://api.github.com/users/sprat","html_url":"https://github.com/sprat","followers_url":"https://api.github.com/users/sprat/followers","following_url":"https://api.github.com/users/sprat/following{/other_user}","gists_url":"https://api.github.com/users/sprat/gists{/gist_id}","starred_url":"https://api.github.com/users/sprat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprat/subscriptions","organizations_url":"https://api.github.com/users/sprat/orgs","repos_url":"https://api.github.com/users/sprat/repos","events_url":"https://api.github.com/users/sprat/events{/privacy}","received_events_url":"https://api.github.com/users/sprat/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T05:39:13Z","updated_at":"2016-01-08T05:39:13Z","body":"Fair enough. I'm trying to implement the flattening in my hyperscript function and on the output of the component's rendering function like you describe and I didn't see the flattening problem. You are right, it would probably have an impact on performance. So, I close this issue. "}}