[PR #1064] [MERGED] Integrate useMemo into useLiveQuery #3497

Closed
opened 2026-02-28 20:42:30 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1064
Author: @j-f1
Created: 5/26/2023
Status: Merged
Merged: 5/28/2023
Merged by: @j-f1

Base: masterHead: jed/live-query-memo


📝 Commits (3)

📊 Changes

6 files changed (+26 additions, -16 deletions)

View changed files

📝 .eslintrc.js (+6 -0)
📝 packages/desktop-client/src/components/NotesButton.tsx (+2 -4)
📝 packages/loot-core/src/client/data-hooks/accounts.tsx (+1 -1)
📝 packages/loot-core/src/client/data-hooks/payees.tsx (+1 -1)
📝 packages/loot-core/src/client/query-hooks.tsx (+10 -10)
upcoming-release-notes/1064.md (+6 -0)

📄 Description

Since each q call returns a brand new Query object, it will always be necessary to use useMemo to cache the value to avoid recreating the query. As a result, I’ve made useLiveQuery pass its arguments directly into useMemo, so you can’t forget to do so.

Fixes a performance regression from #1061.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/1064 **Author:** [@j-f1](https://github.com/j-f1) **Created:** 5/26/2023 **Status:** ✅ Merged **Merged:** 5/28/2023 **Merged by:** [@j-f1](https://github.com/j-f1) **Base:** `master` ← **Head:** `jed/live-query-memo` --- ### 📝 Commits (3) - [`f283f3b`](https://github.com/actualbudget/actual/commit/f283f3bd96a6218b8439a93f19f49da49147c05e) Use useMemo in useLiveQuery - [`a142dd9`](https://github.com/actualbudget/actual/commit/a142dd9146ff74fd716fcff89f7f7b6d5cc873bf) Inline useMemo into useLiveQuery - [`c354697`](https://github.com/actualbudget/actual/commit/c35469733175e3987e8fc51ccfbb043b64fd60e9) Add release note ### 📊 Changes **6 files changed** (+26 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `.eslintrc.js` (+6 -0) 📝 `packages/desktop-client/src/components/NotesButton.tsx` (+2 -4) 📝 `packages/loot-core/src/client/data-hooks/accounts.tsx` (+1 -1) 📝 `packages/loot-core/src/client/data-hooks/payees.tsx` (+1 -1) 📝 `packages/loot-core/src/client/query-hooks.tsx` (+10 -10) ➕ `upcoming-release-notes/1064.md` (+6 -0) </details> ### 📄 Description Since each `q` call returns a brand new `Query` object, it will always be necessary to use `useMemo` to cache the value to avoid recreating the query. As a result, I’ve made `useLiveQuery` pass its arguments directly into `useMemo`, so you can’t forget to do so. Fixes a performance regression from #1061. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:42:30 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#3497