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

update FuncUI sample to preserve state when reloading #8

Merged
merged 1 commit into from
Aug 3, 2021
Merged

update FuncUI sample to preserve state when reloading #8

merged 1 commit into from
Aug 3, 2021

Conversation

uxsoft
Copy link
Contributor

@uxsoft uxsoft commented Jul 20, 2021

This pull request implements state preservation for the FuncUI sample.
Every time the state changes it is saved to window.DataContext and when CreateView is called the old state is converted to the new object by serialization and used as the initial state.

This is especially useful in Elmish programs where the state is centralized and therefore it's possible to restore all the state in all cases.

@uxsoft
Copy link
Contributor Author

uxsoft commented Aug 2, 2021

@AngelMunoz
Copy link
Contributor

This one looks pretty neat do you know if there are performance issues with trace? (looks good to me btw)

@uxsoft
Copy link
Contributor Author

uxsoft commented Aug 2, 2021

I haven't tested the performance, that said (probably another PR) I'd like the hot reload to be only active in dev. In production, we should have a compiler condition and return a standard window.

@uxsoft
Copy link
Contributor Author

uxsoft commented Aug 3, 2021

Is there anything else I need to do? Who will merge this (I don't have the permissions to merge)?

@AngelMunoz AngelMunoz merged commit 00b87c1 into AvaloniaUI:main Aug 3, 2021
@uxsoft uxsoft deleted the samples/funcui-sample-preserve-statem branch August 3, 2021 21:41
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

Successfully merging this pull request may close these issues.

3 participants