Skip to content

Instantly share code, notes, and snippets.

@styk-tv
Last active September 4, 2024 16:46
Show Gist options
  • Save styk-tv/a3ec64ee3eef039fd77416d22f1988db to your computer and use it in GitHub Desktop.
Save styk-tv/a3ec64ee3eef039fd77416d22f1988db to your computer and use it in GitHub Desktop.
xrstorage.js
const xrstorage = {
storage: {},
save: function(key, value) {
this.storage[key] = value;
console.log(`Saved: ${key} = ${value}`);
},
load: function(key) {
const value = this.storage[key];
console.log(`Loaded: ${key} = ${value}`);
return value;
},
loadAll: function() {
console.log("Loading all data:", this.storage);
return this.storage;
}
};
console.log("xrstorage is loaded and ready to use");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment