export interface StoreFunction { (): T; state?: T; } // 状态管理 export function useStore(f: StoreFunction) { if (!f.state) f.state = f(); return f.state; }