Skip to content

Instantly share code, notes, and snippets.

@deanlandolt
Created January 20, 2010 18:39
Show Gist options
  • Save deanlandolt/282078 to your computer and use it in GitHub Desktop.
Save deanlandolt/282078 to your computer and use it in GitHub Desktop.
/**
* A store wrapper for collecting multiple object stores into packages
*/
var Model = require("model").Model;
exports.Package = function(name, model, stores) {
if(!stores){
stores = model;
model = {};
}
var store = {
get: function(id) { return {hi: id} },
openObjectStore: function(storeName) {
return stores[storeName];
}
};
model = Model(name, store, model);
return store;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment