feat: Implement React Query hooks for managing bounties - #30
Merged
0xdevcollins merged 1 commit intoJan 25, 2026
Merged
Conversation
…ching, infinite listing, and CRUD operations.
📝 WalkthroughWalkthroughThis pull request introduces four custom React Query hook modules for bounty data management. The changes create reusable hooks for fetching bounty lists, single bounties, and performing mutations (create, update, delete, claim), alongside support for infinite pagination and cache key management. Changes
Sequence Diagram(s)sequenceDiagram
actor Component
participant Query as React Query Hook
participant Client as Query Client
participant API as Bounties API
Component->>Query: useBounties(params) / useBounty(id)
Query->>Client: Check cache with bountyKeys
alt Cache Hit
Client-->>Query: Return cached data
else Cache Miss
Query->>API: bountiesApi.list(params) / getById(id)
API-->>Query: Return Bounty data
Query->>Client: Update cache
end
Query-->>Component: Return loading, error, data state
sequenceDiagram
actor Component
participant Mutation as Mutation Hook
participant Client as Query Client
participant API as Bounties API
Component->>Mutation: useCreateBounty() / useUpdateBounty() / useDeleteBounty()
Mutation->>Client: onMutate: Save previous data
Client-->>Mutation: Return rollback context
Mutation->>Client: Optimistic update (if applicable)
Mutation->>API: Call API endpoint
alt Success
API-->>Mutation: Success response
Mutation->>Client: Invalidate bountyKeys
else Error
Mutation->>Client: Rollback to previous data
end
Mutation-->>Component: Return mutation state (status, data, error)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
Contributor
|
LGTM 🚀 |
This was referenced Jan 25, 2026
0xDeon
pushed a commit
to 0xDeon/bounties
that referenced
this pull request
Jan 26, 2026
…om-react-query-hooks feat: Implement React Query hooks for managing bounties
This was referenced Jan 27, 2026
This was referenced Feb 19, 2026
This was referenced Mar 26, 2026
Closed
This was referenced Apr 23, 2026
Closed
This was referenced Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new set of React Query hooks for managing bounties, including fetching, updating, deleting, and infinite scrolling of bounty data. The changes modularize and streamline bounty-related data fetching and mutations, making the codebase more maintainable and improving the developer experience when working with bounty features.
New React Query hooks for bounties:
useBountiesfor fetching paginated lists of bounties, along with a sharedbountyKeysutility for consistent query keys.useBountyfor fetching a single bounty by ID with optional query enabling.useInfiniteBountiesfor infinite scrolling of bounty lists, including a helper to flatten paginated results.Mutation hooks for bounties:
useCreateBounty,useUpdateBounty,useDeleteBounty, anduseClaimBountyhooks for creating, updating (with optimistic updates), deleting (with optimistic removal and rollback), and claiming bounties, all with appropriate cache invalidation and updates.closes #28
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.