Skip to content

Instantly share code, notes, and snippets.

@deanlandolt
Created January 15, 2010 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deanlandolt/278487 to your computer and use it in GitHub Desktop.
Save deanlandolt/278487 to your computer and use it in GitHub Desktop.
/**
* A wrapper store to aggregate stores of different types as nested child stores
*/
exports.MultiType = function(entityStores) {
openObjectStore: function(storeName){
// handle nested stores with nested paths
var store = entityStores[storeName];
if(store) {
return store;
}
return entityStores[storeName] = Remote(function(req){
req.url = storeName + '/' + req.url;
return request(req);
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment