feat(cache): 新增 index.ts 公共 API 聚合导出
This commit is contained in:
27
src/shared/lib/cache/index.ts
vendored
Normal file
27
src/shared/lib/cache/index.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 缓存基础设施公共 API。
|
||||
*
|
||||
* 服务端调用方使用:
|
||||
* - data-access:`cacheFn(fn, { tags, ttl, keyParts })` 包装查询函数
|
||||
* - actions:`invalidateFor(actionId, params)` 编排写操作后失效
|
||||
*
|
||||
* 客户端调用方使用:
|
||||
* - `CLIENT_INVALIDATION_MAP` 查询 queryKey 失效列表(自动由 useActionMutation 调用)
|
||||
*/
|
||||
|
||||
export { cacheFn } from "./cache-fn"
|
||||
export { invalidateFor } from "./invalidate"
|
||||
export {
|
||||
INVALIDATION_MAP,
|
||||
fillTemplate,
|
||||
} from "./invalidation-map"
|
||||
export type {
|
||||
CacheFnOptions,
|
||||
CacheStore,
|
||||
InvalidationRule,
|
||||
} from "./types"
|
||||
export type { InvalidationActionId } from "./invalidation-map"
|
||||
|
||||
// 客户端可见的子集(无 server-only 依赖)
|
||||
export { CLIENT_INVALIDATION_MAP } from "./client-invalidation-map"
|
||||
export type { ClientInvalidationActionId } from "./client-invalidation-map"
|
||||
Reference in New Issue
Block a user