Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created December 1, 2011 18:24
Show Gist options
  • Save Raynos/1418758 to your computer and use it in GitHub Desktop.
Save Raynos/1418758 to your computer and use it in GitHub Desktop.
DOM data stores
var uuid = 0,
domShimString = "__domShim__";
var dataManager = {
_stores: {},
getStore: function _getStore(el) {
var id = el[str];
if (id === undefined) {
return this._createStore(el);
}
return this._stores[str + id];
},
_createStore: function _createStore(el) {
var store = {};
this._stores[str + uuid] = store;
el[str] = uuid;
uuid++;
return store;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment