-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(state): New state system #1025
Conversation
|
|
2 similar comments
|
|
UI Automated Tests execution is complete! You can find the test results report here |
This looks cool but I'm not sure how much it will help at the moment. If a message is updated, the messages still need to be grouped and I believe that would still cause a re-render. Fortunately the chats page has been refactored to not store so many messages in memory. I wonder if this could help in other parts of the codebase. For example - if a friend comes online, it might be nice to not re-render stuff that doesn't include that friend. Still, for stuff like that I have a theory that it may be easier to have a top level element that pulls everything it needs from State and passes it to a child Element via props. That way if State is updated, in theory the child elements may have the same props and if props don't change, the element doesn't get re-rendered. (this is easier said than done because State gets used everywhere). |
unless we do it across the whole app (and not just messages) the gain atm isn't really big. |
Closing this for now and we will revisit after the next release of Dioxus. |
What this PR does 📖
local subscriptiondioxus signals.State
in uplink. We will likely only notice it if the wholeState
uses this system.- TODO:- [x] Local Subscription system- [ ] Wrap needed uplink state fields inLocalSubscription
- [ ] Change methods in state so they properly subscribe to their correct local subsSignals
are used here just as a wrapper around the actual value. Writing to/Reading from it is simply done via the simple read and write functions. Dioxus will handle updating the correct components