I’ve been trying to figure out how to extend Ember Data states for some time now. The problem is that I need to add an event to a particular state, specifically I need to add loadedData to the state rootState.loaded.updated.uncommitted and also perhaps rootState.loaded.created.uncommitted.
The main problem I’ve encountered is that all of these variables are defined in a closure in the compiled ember-data source, which means I can’t simply access and extend the objects. I’ve been trying to figure out how to do this and the solution I have currently is to copy all the necessary parts of the closure and recreate the object, then reopen DS.StateManger and set states to the new recreated object.
This all seems very un-Ember-like as there is almost always a way to hook into and extend Ember objects. Is there a cleaner way of doing this?