Skip to content

Commit

Permalink
doc: fix cacheKey default value
Browse files Browse the repository at this point in the history
  • Loading branch information
brickspert committed Mar 31, 2022
1 parent d6ca2b6 commit 4e2a133
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/hooks/src/useRequest/doc/cache/cache.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface CachedData<TData, TParams> {

| Property | Description | Type | Default |
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|----------|
| cacheKey | A unique ID of the request. If `cacheKey` is set, we will enable the caching mechanism. The data of the same `cacheKey` is globally synchronized. | `string` | `[]` |
| cacheKey | A unique ID of the request. If `cacheKey` is set, we will enable the caching mechanism. The data of the same `cacheKey` is globally synchronized. | `string` | - |
| cacheTime | <ul><li> Set the cache time. By default, the cached data will be cleared after 5 minutes.</li><li> If set to `-1`, the cached data will never expire</li></ul> | `number` | `300000` |
| staleTime | <ul><li> Time to consider the cached data is fresh. Within this time interval, the request will not be re-initiated</li><li> If set to `-1`, it means that the data is always fresh</li></ul> | `number` | `0` |
| setCache | <ul><li> Custom set cache </li><li> `setCache` and `getCache` need to be used together</li><li> In the custom cache mode, `cacheTime` and `clearCache` are useless, please implement it yourself according to the actual situation.</li></ul> | `(data: CachedData) => void;` | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useRequest/doc/cache/cache.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface CachedData<TData, TParams> {

| 参数 | 说明 | 类型 | 默认值 |
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|----------|
| cacheKey | 请求唯一标识。如果设置了 `cacheKey`,我们会启用缓存机制。同一个 `cacheKey` 的数据全局同步。 | `string` | `[]` |
| cacheKey | 请求唯一标识。如果设置了 `cacheKey`,我们会启用缓存机制。同一个 `cacheKey` 的数据全局同步。 | `string` | - |
| cacheTime | <ul><li> 设置缓存数据回收时间。默认缓存数据 5 分钟后回收 </li><li> 如果设置为 `-1`, 则表示缓存数据永不过期</li></ul> | `number` | `300000` |
| staleTime | <ul><li> 缓存数据保持新鲜时间。在该时间间隔内,认为数据是新鲜的,不会重新发请求 </li><li> 如果设置为 `-1`,则表示数据永远新鲜</li></ul> | `number` | `0` |
| setCache | <ul><li> 自定义设置缓存 </li><li> `setCache``getCache` 需要配套使用</li><li> 在自定义缓存模式下,`cacheTime``clearCache` 不会生效,请根据实际情况自行实现。</li></ul> | `(data: CachedData) => void;` | - |
Expand Down

0 comments on commit 4e2a133

Please sign in to comment.