storage-ts
v0.1.4
Published
sessionStorage & localStorage
Downloads
8
Maintainers
Readme
storage
description
SessionStorage is used by default unless you specify 'local' in the parameter specified.
usage
Storage.clear()
Storage.clear()
is equivalent to sessionStorage.clear()
.
If you want to use localStorage
, you only need to pass the parameter to the string 'local'
.
Storage.clear('local')
is equivalent to localStorage.clear()
.
Storage.getItem(key)
Storage.getItem(key)
is equivalent to sessionStorage.getItem(key)
.
Storage.getItem(key, 'local')
is equivalent to localStorage.getItem(key)
.