Skip to content
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

Get rid of TreeStateContext / StateHolder's #27

Open
helje5 opened this issue Jul 2, 2019 · 0 comments
Open

Get rid of TreeStateContext / StateHolder's #27

helje5 opened this issue Jul 2, 2019 · 0 comments

Comments

@helje5
Copy link
Member

helje5 commented 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.

@helje5 helje5 changed the title Get rid of TreeStateContext Get rid of TreeStateContext / StateHolder's Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant