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
TreeStateContext as a state holder is kinda superfluous and mostly complicates things. Since we have the old tree anyways (which also happens to carry instances of the view structs), we can as well use that to store the state (which we even do already for closures).
The original idea behind the state context was to have a single, defined, location for persistent state. Instead of having to keep the whole rendering tree around.
The way this would work is that we could get rid of the state holders. The view structs within the DynamicElementNode's themselves become the state holders. And when we create new instances of the same view in a new render tree, we need to fill in the view from there.
It's a little bit of fiddling to get this right, but it would probably be closer to what the original is doing.
The text was updated successfully, but these errors were encountered:
helje5
changed the title
Get rid of TreeStateContext
Get rid of TreeStateContext / StateHolder's
Jul 2, 2019
TreeStateContext as a state holder is kinda superfluous and mostly complicates things. Since we have the old tree anyways (which also happens to carry instances of the view structs), we can as well use that to store the state (which we even do already for closures).
The original idea behind the state context was to have a single, defined, location for persistent state. Instead of having to keep the whole rendering tree around.
The way this would work is that we could get rid of the state holders. The view structs within the DynamicElementNode's themselves become the state holders. And when we create new instances of the same view in a new render tree, we need to fill in the view from there.
It's a little bit of fiddling to get this right, but it would probably be closer to what the original is doing.
The text was updated successfully, but these errors were encountered: