Skip to content

feat: migrate useTransactionHistory to TanStack Query #44

Closed

Description

@Gaubee

背景

基于 PR #43 引入的 TanStack Query 推送式数据服务架构,继续改造其他数据获取接口。

当前问题

src/hooks/use-transaction-history.ts 使用手动 useEffect 获取数据,导致:

  • TransferTab 每次切换都重新请求
  • 无法共享缓存
  • 手动管理 loading/error 状态

改造目标

创建 useTransactionHistoryQuery hook:

  • staleTime: 30s(Tab 切换不重复请求)
  • 支持分页 (useInfiniteQuery)
  • 支持按链/时间筛选
  • 共享缓存

涉及文件

  • src/hooks/use-transaction-history.ts
  • src/stackflow/activities/tabs/TransferTab.tsx
  • src/pages/history/index.tsx

关联

Part of TanStack Query migration series (PR #43)

Activity

  1. added a commit that references this issue on Dec 22, 2025
    991eb8f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions