cache
handle storing data to localStorage
Last updated
handle storing data to localStorage
Last updated
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