{"action":"created","issue":{"url":"https://api.github.com/repos/AmpersandJS/ampersand-view/issues/40","labels_url":"https://api.github.com/repos/AmpersandJS/ampersand-view/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/AmpersandJS/ampersand-view/issues/40/comments","events_url":"https://api.github.com/repos/AmpersandJS/ampersand-view/issues/40/events","html_url":"https://github.com/AmpersandJS/ampersand-view/pull/40","id":39871796,"number":40,"title":"merge parent definitions onto the child when extending","user":{"login":"lukekarrys","id":542108,"avatar_url":"https://avatars.githubusercontent.com/u/542108?v=3","gravatar_id":"","url":"https://api.github.com/users/lukekarrys","html_url":"https://github.com/lukekarrys","followers_url":"https://api.github.com/users/lukekarrys/followers","following_url":"https://api.github.com/users/lukekarrys/following{/other_user}","gists_url":"https://api.github.com/users/lukekarrys/gists{/gist_id}","starred_url":"https://api.github.com/users/lukekarrys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukekarrys/subscriptions","organizations_url":"https://api.github.com/users/lukekarrys/orgs","repos_url":"https://api.github.com/users/lukekarrys/repos","events_url":"https://api.github.com/users/lukekarrys/events{/privacy}","received_events_url":"https://api.github.com/users/lukekarrys/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AmpersandJS/ampersand-view/labels/discussion","name":"discussion","color":"d4c5f9"},{"url":"https://api.github.com/repos/AmpersandJS/ampersand-view/labels/enhancement","name":"enhancement","color":"207de5"},{"url":"https://api.github.com/repos/AmpersandJS/ampersand-view/labels/request","name":"request","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-08-08T23:34:23Z","updated_at":"2015-05-21T08:26:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/AmpersandJS/ampersand-view/pulls/40","html_url":"https://github.com/AmpersandJS/ampersand-view/pull/40","diff_url":"https://github.com/AmpersandJS/ampersand-view/pull/40.diff","patch_url":"https://github.com/AmpersandJS/ampersand-view/pull/40.patch"},"body":"Added this behavior for events/bindings/subviews hashes\r\n\r\nCloses #39 "},"comment":{"url":"https://api.github.com/repos/AmpersandJS/ampersand-view/issues/comments/104177280","html_url":"https://github.com/AmpersandJS/ampersand-view/pull/40#issuecomment-104177280","issue_url":"https://api.github.com/repos/AmpersandJS/ampersand-view/issues/40","id":104177280,"user":{"login":"pgilad","id":4533329,"avatar_url":"https://avatars.githubusercontent.com/u/4533329?v=3","gravatar_id":"","url":"https://api.github.com/users/pgilad","html_url":"https://github.com/pgilad","followers_url":"https://api.github.com/users/pgilad/followers","following_url":"https://api.github.com/users/pgilad/following{/other_user}","gists_url":"https://api.github.com/users/pgilad/gists{/gist_id}","starred_url":"https://api.github.com/users/pgilad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgilad/subscriptions","organizations_url":"https://api.github.com/users/pgilad/orgs","repos_url":"https://api.github.com/users/pgilad/repos","events_url":"https://api.github.com/users/pgilad/events{/privacy}","received_events_url":"https://api.github.com/users/pgilad/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T08:26:10Z","updated_at":"2015-05-21T08:26:10Z","body":"I would vote against adding a flag for property merges. That would cause debugging hell down the line.\r\nIf users wish to merge properties, provide a mixin module that will take 2 hashes (nested as well for props whatsoever) and return a mixed hash:\r\n\r\n```js\r\nvar unit1 = View.extend({\r\n    events: {\r\n        'click [role=\"reset\"]': 'resetSomething'\r\n    }\r\n});\r\n\r\nvar unit2 = View.extend({\r\n    events: {\r\n        'blur [role=\"reset\"]': 'doSomething'\r\n    }\r\n});\r\n\r\n// use lodash.assign or lodash.merge (for recursive) or any custom merge module\r\nunit2.prototype.events = _.assign({}, unit1.events, unit2.events);\r\n```\r\n\r\nThis way users can choose whether to merge properties, and also (as important) in what order.\r\n\r\n[Favor composition over inheritance](http://en.wikipedia.org/wiki/Composition_over_inheritance)"}}