refactor: 股票数据管理迁移到 Redux,新增类型化 Hooks

- stockSlice: 新增 loadAllStocks action(带缓存检查)
 - stockSlice: watchlist 结构升级为 { stock_code, stock_name }[]
 - store/hooks.ts: 新增 useAppDispatch, useAppSelector 类型化 hooks
 - stockService: 移除 getAllStocks(已迁移到 Redux)
 - mock: 股票搜索支持模糊匹配 + 相关性排序
This commit is contained in:
zdl
2025-12-05 17:21:36 +08:00
parent 74eae630dd
commit e8a9a6f180
5 changed files with 122 additions and 63 deletions

View File

@@ -63,4 +63,9 @@ export const injectReducer = (key, reducer) => {
store.replaceReducer(createRootReducer());
};
/**
* @typedef {typeof store.dispatch} AppDispatch
* @typedef {ReturnType<typeof store.getState>} RootState
*/
export default store;