cache
handle storing data to localStorage
How to use
Cache payload
Param
Typeof
Default
Required
Description
key
String
null
✅
the cache key to be used to save/get/remove your data from localStorage.
data
Any
null
✅
the data item to be stored.
expire
Number
0
❌
when the data should be expired in localStorage
callback
Function
null
❌
a callback will be called when the data is saved/removed from localStorage
method
String
GET
❌
a method to save/get/remove available: GET, POST, DELETE
Save data to localStorage
Get data from localStorage
Remove data from localStorage
Last updated