Skip to content

Instantly share code, notes, and snippets.

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 pfftdammitchris/33ab667c5081eed7416d2817b2de901e to your computer and use it in GitHub Desktop.
Save pfftdammitchris/33ab667c5081eed7416d2817b2de901e to your computer and use it in GitHub Desktop.
class LocalStorage {
#data = {}
constructor(options) {
this.options = options || {}
}
get(key) {
return this.#data[key]
}
set(key, value) {
this.#data[key] = value
}
remove(key) {
delete this.#data[key]
}
clear() {
this.#data = {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment