Replies: 1 comment 1 reply
-
Hi @brennobemoura, this probably isn't something we will bring into the library. It adds another layer of indentation, and it's yet another concept to learn. In the end we are moving in a direction that allows us to get rid of the view store entirely (and |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Adopting a view like
WithObjectUnchanged
could be used to prevent rebuilding the ViewStore when the initial State remains the same.The ideia is to add the Equatable conformance to Reducer.State so we could use
WithObjectUnchanged
to verify if updating the viewStore is truly necessary.This way, we could have something like this:
With this approach, the block initializing the ViewStore is executed only once, regardless of how many times the body is called. The view will only be rebuilt if the input, in this case the Scene property, is updated with a new value.
Beta Was this translation helpful? Give feedback.
All reactions