store
minimal store inspired by component/cookie
Installation
$ component install yields/store
Example
;; // > ['baz'];; // > 'baz';; // > null;; // > { baz: 0 };; // > {}
API
store(key, val)
set key
to val
, the value will be JSON.stringify()
ied.
store(obj)
store the given object
.
store(key, null)
remove key
.
store(key)
get key
value, it will be unserialized.
store(null)
invokes localStorage.clear()
store()
get all items, they will be unserialized.
License
MIT