{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/1484","repository_url":"https://api.github.com/repos/lhorie/mithril.js","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1484/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1484/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1484/events","html_url":"https://github.com/lhorie/mithril.js/issues/1484","id":196227641,"number":1484,"title":"[rewrite] consideration for component initial state config","user":{"login":"cavemansspa","id":17560206,"avatar_url":"https://avatars.githubusercontent.com/u/17560206?v=3","gravatar_id":"","url":"https://api.github.com/users/cavemansspa","html_url":"https://github.com/cavemansspa","followers_url":"https://api.github.com/users/cavemansspa/followers","following_url":"https://api.github.com/users/cavemansspa/following{/other_user}","gists_url":"https://api.github.com/users/cavemansspa/gists{/gist_id}","starred_url":"https://api.github.com/users/cavemansspa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cavemansspa/subscriptions","organizations_url":"https://api.github.com/users/cavemansspa/orgs","repos_url":"https://api.github.com/users/cavemansspa/repos","events_url":"https://api.github.com/users/cavemansspa/events{/privacy}","received_events_url":"https://api.github.com/users/cavemansspa/received_events","type":"User","site_admin":false},"labels":[{"id":86465859,"url":"https://api.github.com/repos/lhorie/mithril.js/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":362013854,"url":"https://api.github.com/repos/lhorie/mithril.js/labels/rewrite","name":"rewrite","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-17T15:37:14Z","updated_at":"2016-12-18T16:07:36Z","closed_at":null,"body":"One thought after first v1 test drive.  Would there be a consideration for an explicit state configuration block?  Currently, it looks like all of the component's properties are copied to vnode.state on initialization.\r\n\r\nAn alternative would be to provide a \"config\" block that the component writer can explicitly define the object they want copied to vnode.state.  Similar to the manual steps that are done in this fiddle: https://jsfiddle.net/4xazqtjd/8/\r\n\r\nIf the \"config\" block contains a function, mithril, will scope it with vnode.state and vnode arg, effectively giving you a user-defined lifecycle like function on the component.\r\n\r\nThis suggestion would enable a mechanism that let's the component writer implement component level and instance level functions.\r\n"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/267829602","html_url":"https://github.com/lhorie/mithril.js/issues/1484#issuecomment-267829602","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1484","id":267829602,"user":{"login":"lhorie","id":1637573,"avatar_url":"https://avatars.githubusercontent.com/u/1637573?v=3","gravatar_id":"","url":"https://api.github.com/users/lhorie","html_url":"https://github.com/lhorie","followers_url":"https://api.github.com/users/lhorie/followers","following_url":"https://api.github.com/users/lhorie/following{/other_user}","gists_url":"https://api.github.com/users/lhorie/gists{/gist_id}","starred_url":"https://api.github.com/users/lhorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhorie/subscriptions","organizations_url":"https://api.github.com/users/lhorie/orgs","repos_url":"https://api.github.com/users/lhorie/repos","events_url":"https://api.github.com/users/lhorie/events{/privacy}","received_events_url":"https://api.github.com/users/lhorie/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T16:07:36Z","updated_at":"2016-12-18T16:07:36Z","body":"On one hand, I think it makes phylosophical sense to have a distinction between static and instance methods. On the other, from an architectural perspective, I've been leaning heavily towards lean component. Somehow every time I make fat components, it comes back to bite me"}}
{"actor":{"display_login":"lhorie"}}