{"action":"created","issue":{"url":"https://api.github.com/repos/brainshave/ancient-oak/issues/13","repository_url":"https://api.github.com/repos/brainshave/ancient-oak","labels_url":"https://api.github.com/repos/brainshave/ancient-oak/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/brainshave/ancient-oak/issues/13/comments","events_url":"https://api.github.com/repos/brainshave/ancient-oak/issues/13/events","html_url":"https://github.com/brainshave/ancient-oak/issues/13","id":41536413,"number":13,"title":"Ember usage example","user":{"login":"kristianmandrup","id":125005,"avatar_url":"https://avatars.githubusercontent.com/u/125005?v=3","gravatar_id":"","url":"https://api.github.com/users/kristianmandrup","html_url":"https://github.com/kristianmandrup","followers_url":"https://api.github.com/users/kristianmandrup/followers","following_url":"https://api.github.com/users/kristianmandrup/following{/other_user}","gists_url":"https://api.github.com/users/kristianmandrup/gists{/gist_id}","starred_url":"https://api.github.com/users/kristianmandrup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristianmandrup/subscriptions","organizations_url":"https://api.github.com/users/kristianmandrup/orgs","repos_url":"https://api.github.com/users/kristianmandrup/repos","events_url":"https://api.github.com/users/kristianmandrup/events{/privacy}","received_events_url":"https://api.github.com/users/kristianmandrup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-08-29T20:24:02Z","updated_at":"2016-03-03T05:48:34Z","closed_at":null,"body":"I just watched your EmberLondon presentation and was very intrigued. Reminds me a bit of the ReactJS concept to boost performance. Much faster to do reference equality checks than deep value checks. \r\n\r\nHowever not sure if it would screw up the Ember observer model, changing the pointers. I guess this is why React functions without observers and data binding?\r\n\r\nWould something like this work? or should I inject this at the routing level? \r\n\r\nhttp://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/\r\n\r\n```\r\nNative arrays will no longer implement the functionality needed to observe them. If you disable prototype extension and attempt to use native arrays with things like a template's {{#each}} helper, Ember.js will have no way to detect changes to the array and the template will not update as the underlying array changes.\r\n\r\nAdditionally, if you try to set the model of an Ember.ArrayController to a plain native array, it will raise an exception since it no longer implements the Ember.Array interface.\r\n\r\nYou can manually coerce a native array into an array that implements the required interfaces using the convenience method Ember.A\r\n```\r\n\r\nhttp://madhatted.com/2013/5/17/observing-enumerables-and-arrays-with-ember-js\r\n\r\nWould be nice at least to leverage the efficient versioning capabilities, such as rollback (undo).\r\nBut look like it takes a bit more tweaking to make Oak play nice with Ember datatypes such as Ember.Array.\r\n\r\nLooks like an ImmutableArray using Oak would have to proxy or mixin  Ember.Array API as defined in `ember-runtime/lib/mixins/array.js`\r\n\r\n```\r\nlength, objectAt, objectsAt, nextObject, \"[]\", firstObject, lastObject, contains, slice, indexOf, lastIndexOf,\r\naddArrayObserver, removeArrayObserver, hasArrayObservers, arrayContentWillChange, arrayContentDidChange, '@each'\r\n```\r\n\r\nI wonder if that would be enough, at least for Array!?\r\n\r\nFor an Object, it must at least proxy or mixin Observable in `ember-runtime/lib/mixins/observable.js`.\r\n\r\n```javascript\r\nvar Oak = I; // alias\r\n\r\nApp.ImmutableDataWrapper = Ember.Mixin.create({\r\n  immutable: function(data) {\r\n    return Oak(data);\r\n  }\r\n})\r\n\r\nApp.ImmutableObjectController = Ember.ObjectController.extend(App.ImmutableDataWrapper, {\r\n  various key functions that normally return mutable object: {\r\n    // wrap as immutable array :)\r\n    return this.immutable(this._super());\r\n  }\r\n\r\nApp.ImmutableArrayController = Ember.ArrayController.extend(App.ImmutableDataWrapper, {\r\n    various key functions that normally return a mutable array: {\r\n    // wrap as immutable object :)\r\n    return this.immutable(this._super());\r\n  }\r\n}\r\n\r\nApp.PostsController = App.ImmutableArrayController.extend({})\r\n```"},"comment":{"url":"https://api.github.com/repos/brainshave/ancient-oak/issues/comments/191593226","html_url":"https://github.com/brainshave/ancient-oak/issues/13#issuecomment-191593226","issue_url":"https://api.github.com/repos/brainshave/ancient-oak/issues/13","id":191593226,"user":{"login":"jgwhite","id":34030,"avatar_url":"https://avatars.githubusercontent.com/u/34030?v=3","gravatar_id":"","url":"https://api.github.com/users/jgwhite","html_url":"https://github.com/jgwhite","followers_url":"https://api.github.com/users/jgwhite/followers","following_url":"https://api.github.com/users/jgwhite/following{/other_user}","gists_url":"https://api.github.com/users/jgwhite/gists{/gist_id}","starred_url":"https://api.github.com/users/jgwhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgwhite/subscriptions","organizations_url":"https://api.github.com/users/jgwhite/orgs","repos_url":"https://api.github.com/users/jgwhite/repos","events_url":"https://api.github.com/users/jgwhite/events{/privacy}","received_events_url":"https://api.github.com/users/jgwhite/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T05:48:34Z","updated_at":"2016-03-03T05:48:34Z","body":"@kristianmandrup I’m extremely interested in using Ancient Oak as the backing store for Redux because it promises such highly optimised performance for deep-tree patches.\r\n\r\nHere’s a sketch of how you might use it with Ember:\r\nhttps://ember-twiddle.com/aa0efa238baa1122d541?fileTreeShown=false&openFiles=services.store.js"}}