1.0.4 • Published 6 years ago

jfetchs v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

jfetchs

NPM version Build Status Coverage Status

封装获取缓存的方法 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

1.0.4

6 years ago

1.0.0

6 years ago

0.1.27

6 years ago

0.1.26

6 years ago

0.1.15

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.3

6 years ago

0.1.0

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.7

6 years ago

0.0.1

6 years ago