Optimize Cache, Subscription & Pagination Handling - useSubscription.ts#84
Open
Cherkaso8 wants to merge 1 commit into
Open
Optimize Cache, Subscription & Pagination Handling - useSubscription.ts#84Cherkaso8 wants to merge 1 commit into
Cherkaso8 wants to merge 1 commit into
Conversation
Improvements provide cleaner, more compact and readable code. Status updates and demo are minimized, which should speed up the application. The code has become easier to test and maintain thanks to an improved structure and more rigorous typing.
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 PR introduces optimizations and fixes to the
useSubscription.tsfile to enhance caching and subscription handling. Here’s a summary of the changes:1. Consolidation of Types:
HookOptionsandPaginatedHookOptions.2. Improved Cache Handling:
useRequestDatahook to ensure better handling of stale data whenkeepStaleDatais enabled.3. Fixed Subscription State Management:
useSubscriptionto properly merge and update subscription data in real time, while respecting cache policies.4. Paginated Request Fix:
usePaginatedRequestto handle pagination more effectively by properly managing cache and data fetching.5. Merged Subscription & Paginated Data:
usePaginatedSubscriptionto ensure that paginated and subscription data are merged correctly, avoiding duplication.