Skip to content
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

Feature Request: Event for changed table & entry ID #381

Open
negue opened this issue Apr 8, 2024 · 0 comments
Open

Feature Request: Event for changed table & entry ID #381

negue opened this issue Apr 8, 2024 · 0 comments

Comments

@negue
Copy link
Collaborator

negue commented Apr 8, 2024

Feature Request

A batched event / subscribeChangedTables (or something like that) which contains the Table Name and the Changed IDs of that Table. Or maybe this could be added to the syncState

Usecase

I'm building some kind of time tracker, which shows a summary of tracked times to a specific topic, In-order to not load/aggregate all the possible tracked times for that one topic (on each view of the page), I wanted to have a simple aggregated cache based on the tracked time entries..

Current "Solution" (I'm using)

Since both Clients can be offline, the aggregated value can differ. (Both clients add a time to a topic, then they sync and then that aggregated number is wrong on both)

The aggregated value is synced as well as in a not synced table that holds the aggregated value, as of right now I'm reading the synced value and the non synced one and compare those, if its different I need to re-trigger an aggregation. And this happens each time the topic is read/rendered. Which is also not that perfect (havent read both caches and invalidate each time)

Thats why I thought having an event that tells me what changed, I can just listen to that and refresh caches as needed, instead of adding checks per render and with that save up useless CPU cycles 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant