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
If you press either of the buttons, the reactive block will be re-evaluated, even though it only depends on the subset of state object. In react, afair, they use shallow compare on component side to determine if relevant pieces of state changed, and this stops redux from triggering render on every state change.
I understand that svelte maybe was not intended to be used with reducers, but I'm currently working on a toy project which gives me an impression that svelte can actually work with reducers very well and even be more convenient than react by using reactive bindings to pieces of state.
Is there anything to automate these compares or maybe plans to support this in future?
This feature seems not very complicated, but will make svelte more appealing to redux fans.
The text was updated successfully, but these errors were encountered:
Woops, I had no idea this section of tutorial may be helpful, so never looked inside until today.
This is enough for my usecases, so I'm closing the issue:
Here's an example:
https://svelte.dev/repl/908698aa30ad46ba92569e5060e6f73b?version=3.4.4
If you press either of the buttons, the reactive block will be re-evaluated, even though it only depends on the subset of state object. In react, afair, they use shallow compare on component side to determine if relevant pieces of state changed, and this stops redux from triggering render on every state change.
I understand that svelte maybe was not intended to be used with reducers, but I'm currently working on a toy project which gives me an impression that svelte can actually work with reducers very well and even be more convenient than react by using reactive bindings to pieces of state.
My current workaround here is to compare manually like this:
https://svelte.dev/repl/c9152261372e4d109352e5ce7da2271d?version=3.4.4
Is there anything to automate these compares or maybe plans to support this in future?
This feature seems not very complicated, but will make svelte more appealing to redux fans.
The text was updated successfully, but these errors were encountered: