@td-design/rn-hooks
Version:
从ahooks里面抽取的一些在rn项目里可以使用的hooks。提高开发效率
17 lines (16 loc) • 603 B
TypeScript
/// <reference types="react-native" />
/// <reference types="node" />
type Timer = ReturnType<typeof setTimeout>;
type CachedKey = string | number;
export interface CachedData<TData = any, TParams = any> {
data: TData;
params: TParams;
time: number;
}
interface RecordData extends CachedData {
timer: Timer | undefined;
}
declare const setCache: (key: CachedKey, cacheTime: number, cachedData: CachedData) => void;
declare const getCache: (key: CachedKey) => RecordData | undefined;
declare const clearCache: (key?: string | string[]) => void;
export { getCache, setCache, clearCache };