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

defonce would preserve app state after hot reloads #366

Open
qrthey opened this issue Jul 31, 2022 · 0 comments
Open

defonce would preserve app state after hot reloads #366

qrthey opened this issue Jul 31, 2022 · 0 comments

Comments

@qrthey
Copy link

qrthey commented Jul 31, 2022

(def click-count (r/atom 0))

In clojurescript the state ratom would typically be defined with defonce instead of with def. Doing so would ensure that the state of the application is kept when new changes are saved (be it in cljs files or stylesheets).

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