{"action":"created","issue":{"url":"https://api.github.com/repos/inf3rno/o3/issues/46","labels_url":"https://api.github.com/repos/inf3rno/o3/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/inf3rno/o3/issues/46/comments","events_url":"https://api.github.com/repos/inf3rno/o3/issues/46/events","html_url":"https://github.com/inf3rno/o3/issues/46","id":106667736,"number":46,"title":"API should be much simpler - translate everything to merge and clone","user":{"login":"inf3rno","id":408911,"avatar_url":"https://avatars.githubusercontent.com/u/408911?v=3","gravatar_id":"","url":"https://api.github.com/users/inf3rno","html_url":"https://github.com/inf3rno","followers_url":"https://api.github.com/users/inf3rno/followers","following_url":"https://api.github.com/users/inf3rno/following{/other_user}","gists_url":"https://api.github.com/users/inf3rno/gists{/gist_id}","starred_url":"https://api.github.com/users/inf3rno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inf3rno/subscriptions","organizations_url":"https://api.github.com/users/inf3rno/orgs","repos_url":"https://api.github.com/users/inf3rno/repos","events_url":"https://api.github.com/users/inf3rno/events{/privacy}","received_events_url":"https://api.github.com/users/inf3rno/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/inf3rno/o3/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/inf3rno/o3/labels/priority:high","name":"priority:high","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"inf3rno","id":408911,"avatar_url":"https://avatars.githubusercontent.com/u/408911?v=3","gravatar_id":"","url":"https://api.github.com/users/inf3rno","html_url":"https://github.com/inf3rno","followers_url":"https://api.github.com/users/inf3rno/followers","following_url":"https://api.github.com/users/inf3rno/following{/other_user}","gists_url":"https://api.github.com/users/inf3rno/gists{/gist_id}","starred_url":"https://api.github.com/users/inf3rno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inf3rno/subscriptions","organizations_url":"https://api.github.com/users/inf3rno/orgs","repos_url":"https://api.github.com/users/inf3rno/repos","events_url":"https://api.github.com/users/inf3rno/events{/privacy}","received_events_url":"https://api.github.com/users/inf3rno/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-09-15T23:19:44Z","updated_at":"2015-10-14T21:37:05Z","closed_at":null,"body":"currently the extend and mixin codes does not meet with the main logic of the lib. I think I should use merge instead of mixin and use clone instead of extend.\r\n\r\ncurrently by nested property inheritance and merge I use deep() with an integrated shallowMerge approach and a nested config object. I don't like these solutions. I mean deep is hard to follow. I think these codes should use clone + merge as well if that is possible. maybe it would be somewhat longer, but I think it is easier to build everything with this 2 simple methods instead of using something else. if it is possible it would be good to give custom clone and merge functions to config objects as well, so we would not need to define those behaviors in a nested config object.\r\n\r\nin general if it is possible, I would describe everything with clone + merge by working with classes. these are simple terms, which most people (programmer) understand."},"comment":{"url":"https://api.github.com/repos/inf3rno/o3/issues/comments/148209598","html_url":"https://github.com/inf3rno/o3/issues/46#issuecomment-148209598","issue_url":"https://api.github.com/repos/inf3rno/o3/issues/46","id":148209598,"user":{"login":"inf3rno","id":408911,"avatar_url":"https://avatars.githubusercontent.com/u/408911?v=3","gravatar_id":"","url":"https://api.github.com/users/inf3rno","html_url":"https://github.com/inf3rno","followers_url":"https://api.github.com/users/inf3rno/followers","following_url":"https://api.github.com/users/inf3rno/following{/other_user}","gists_url":"https://api.github.com/users/inf3rno/gists{/gist_id}","starred_url":"https://api.github.com/users/inf3rno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inf3rno/subscriptions","organizations_url":"https://api.github.com/users/inf3rno/orgs","repos_url":"https://api.github.com/users/inf3rno/repos","events_url":"https://api.github.com/users/inf3rno/events{/privacy}","received_events_url":"https://api.github.com/users/inf3rno/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T21:37:05Z","updated_at":"2015-10-14T21:37:05Z","body":"I think I should forget the ClassBuilder and use something like this:\r\n\r\n```\r\nvar UserError = new Context(Error).meta({\r\n\tconstructor: {\r\n\t\tclone: function (){\r\n\t\t\t// UserError factory\r\n\t\t},\r\n\t\tmerge: deepMerge\r\n\t}\r\n}).clone();\r\n\r\nvar Class = new Context(Object).meta({\r\n\tconstructor: {\r\n\t\tclone: function (){\r\n\t\t\t// Class factory\r\n\t\t},\r\n\t\tmerge: deepMerge\r\n\t}\r\n}).clone();\r\n```\r\n\r\nWhat happens here that I change the context of the clone and merge functions by using the Context class. All I need to define on Context is clone and merge. So for example:\r\n\r\n```\r\nvar o = new Context({}).merge({a:1, b2}).toObject();\r\n```\r\nthis should work as well...\r\n"}}