-
Notifications
You must be signed in to change notification settings - Fork 448
feat: Migrate MarketPerformer from TanStackQuery to RTKQuery #13581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the MarketPerformer feature from TanStack Query to RTK Query, establishing a pattern for future market data state management migrations.
- Introduces RTK Query API setup for market performers with proper caching and polling
- Refactors the
useMarketPerformershook to use the new RTK Query endpoint - Removes legacy TanStack Query implementation and query keys
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
libs/ledger-live-common/src/market/state-manager/api.ts |
Creates new RTK Query API with getMarketPerformers endpoint including query params, response transformation, and caching configuration |
libs/ledger-live-common/src/market/state-manager/types.ts |
Defines types for RTK Query including MarketPerformersQueryParams and tag enums for cache invalidation |
libs/ledger-live-common/src/market/hooks/useMarketPerformers.ts |
Updates hook to use RTK Query's useGetMarketPerformersQuery instead of TanStack's useQuery, replacing refetchInterval with pollingInterval |
libs/ledger-live-common/src/market/api/index.ts |
Removes the legacy fetchMarketPerformers function and unused imports |
libs/ledger-live-common/src/market/utils/queryKeys.ts |
Removes obsolete MarketPerformers query key entry |
apps/ledger-live-mobile/src/context/rtkQueryApi.ts |
Registers the new marketApi reducer and middleware in the mobile app Redux store |
apps/ledger-live-desktop/src/renderer/reducers/rtkQueryApi.ts |
Registers the new marketApi reducer and middleware in the desktop app Redux store |
.changeset/many-snakes-wait.md |
Documents the migration as a minor version change across affected packages |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| export interface MarketPerformersResult { | ||
| data: MarketItemPerformer[]; | ||
| } |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MarketPerformersResult interface is defined but never used in the codebase. The RTK Query endpoint getMarketPerformers returns MarketItemPerformer[] directly, not wrapped in a result object with a data property. This interface should be removed to avoid confusion.
| export interface MarketPerformersResult { | |
| data: MarketItemPerformer[]; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this type be removed as suggested ?
3cb0ca1 to
5b9cb6e
Compare
thesan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
But as part of the migration to RTKQuery I'm wondering if it would make sense to have a single countervalues api encompassing all the usage of env("LEDGER_COUNTERVALUES_API") (countervalues, ofac, market performers, etc...). This way we could just add/remove endpoints from the api in a single place instead of adding removing whole apis for each usage.
WDYT ?
|
|
||
| export interface MarketPerformersResult { | ||
| data: MarketItemPerformer[]; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this type be removed as suggested ?
5b9cb6e to
8b0b2ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|


β Checklist
npx changesetwas attached.π Description
Initiate first step to migrate Market from TanStackQuery to RTK Query
Following dada-client guidelines
β Context
π§ Checklist for the PR Reviewers