You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I understand that Sycamore uses reactivity for fine grained updates. I'm just wondering how to handle receiving fresh state from the server.
In the ELM/React model it's pretty simple conceptually as the entire view is a pure function of state, and I guess that still holds here, but it "feels" like Sycamore is optimised for smaller updates?
For example, if I'm display a list of Widgets I would have a Signal around that list. If I receive a fresh list of Widgets from the server, do I simply replace the contents of the existing Signal, or would I be expected to manually reconcile the old and the new list?
For more context, the updates we get from the server are very coarse - literally, the entire state, regardless of what has changed, so if a new Widget is added then we receive the entire state over, and over (and over). Will it be expensive replacing the state and redrawing the entire UI from scratch every time?
I'm asking the question because with a virtualdom this isn't a conceptual or practical issue as the performance happens in the virtualdom reconciliation. However, without that virtualdom, I can't see how the entire UI isn't redrawn over and over because the signals are replaced?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there, I understand that Sycamore uses reactivity for fine grained updates. I'm just wondering how to handle receiving fresh state from the server.
In the ELM/React model it's pretty simple conceptually as the entire view is a pure function of state, and I guess that still holds here, but it "feels" like Sycamore is optimised for smaller updates?
For example, if I'm display a list of Widgets I would have a
Signal
around that list. If I receive a fresh list of Widgets from the server, do I simply replace the contents of the existingSignal
, or would I be expected to manually reconcile the old and the new list?For more context, the updates we get from the server are very coarse - literally, the entire state, regardless of what has changed, so if a new Widget is added then we receive the entire state over, and over (and over). Will it be expensive replacing the state and redrawing the entire UI from scratch every time?
I'm asking the question because with a virtualdom this isn't a conceptual or practical issue as the performance happens in the virtualdom reconciliation. However, without that virtualdom, I can't see how the entire UI isn't redrawn over and over because the signals are replaced?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions