Last active
December 20, 2015 18:39
-
-
Save teddyzeenny/6177557 to your computer and use it in GitHub Desktop.
Data adapter: option 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getModelTypes: function(typeAdded, typeUpdated, typeRemoved) { | |
// code to fetch types ... | |
// ... | |
// .. setup array observers to call typeAdded, typeUpdated, and typeRemoved on changes | |
var releaseMethod = function() { | |
//.. code to clear all observers | |
}; | |
return { | |
types: RSVP.resolve(initialTypes), // promise that resolves to the initial types | |
release: releaseMethod // method to call to clear observers | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment