refactor(frontend): Migrate state to Tanstack Query + signals#117
Conversation
|
Important Review skippedToo many files! This PR contains 236 files, which is 86 over the limit of 150. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (236)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment Tip CodeRabbit can generate a title for your PR based on the changes.Add |
|
From what I can it is essentially the same pattern repeating again and again. So far I can't see anything obviously wrong, and since it's the same thing repeating, I think, even with the size this PR has, it won't be "hard" to test.
Hell yeah! Any net negative of bloat/spaghetti code/boilerplate is a huge win. |
balazs-szucs
left a comment
There was a problem hiding this comment.
Only thing I was bit worried about was auth, but seems to working just fine.
I've clicking around for the past 1 hour or so, I think everything is really good here!
Thank you again!
…ry-tools#117) * refactor(frontend): migrate state to TanStack Query and signals * fix(frontend): keep book cache in sync after patches
…ry-tools#117) * refactor(frontend): migrate state to TanStack Query and signals * fix(frontend): keep book cache in sync after patches
* refactor(frontend): migrate state to TanStack Query and signals * fix(frontend): keep book cache in sync after patches
* refactor(frontend): migrate state to TanStack Query and signals * fix(frontend): keep book cache in sync after patches
Description
This PR replaces the BehaviorSubject state management and manual patching technique with Tanstack Query for server data and Angular signals for local/derived states.
Key additions (frontend)
book-query-cache.ts- Single place for all adds, patches, removals and invalidations.Outcomes
takeUntil/destroy$/ngOnDestroycleanup from most componentsThis hopefully serves as a much cleaner frontend to implement some more of the bigger data wins (Pagination, server side search and filtering etc). TanStack Query has a built-in
injectInfiniteQueryfunction that automatically handles multiple batches of data, concatenating results, handling "load next" etc. At least on the frontend it should handle all this quite cleanly.Testing
Disclaimer