1.0.4 • Published 6 years ago
jfetchs v1.0.4
jfetchs
封装获取缓存的方法 Cache of fetch data
使用方法 Usage
声明缓存 Declaration cache
var cache = new jfetchs.Cache({
debug: 'localhost',
expire: 60, // 60 seconds
fetch: () => {
return Promise.resolve(Date.now())
},
})
cache.fetch().then(data => {
console.log(data)
})
API
Cache.fetch
/**
* 获取数据 Fetch cached data
* @param key 缓存标志,默认: ''
*/
Cache.fetch(key?: string) {}
Cache.flush
/**
* 移除缓存 Remove cached data
* @param key 缓存标志,默认: ''
*/
Cache.flush(key?: string) {}
License
MIT © zswang