Clojurians
#mount
<
2016-01-23
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

bbss09:01:46

I am kind of confused how to go about using mount with cursive. I want to interact with an api and put the resulting response in an atom. And then play around with that data. But I whenever I change the code and the system detects code changes the state gets reset. Using defonce this wouldn't happen.

bbss09:01:16

How do you guys go about such persisting state in your dev cycles? Do I need to use (mount/stop-except the-state) somehow?

bbss09:01:38

It seems defstate works even without calling mount/start so not sure how that would work

bbss09:01:57

I am using clojurescript with figwheel.

jrychter18:01:41

@tolitius: I'm not opening the issue yet. I upgraded to latest figwheel and the problem almost went away. Only seen it once or twice today, while before it happened all the time.

tolitius22:01:07

@bbss: * is loading data into an atom an expensive operation? * when you "playing around with that data" do you change it in the process? * is this an application state? or this is just dev data (i.e. temp) that is used in REPL, console? if this is the value that is only needed for development, or to play with, it might be ok to just put it in a var as an atom (i.e. not as state).

tolitius23:01:54

@jrychter: niice. I don't use figwheel (use boot-cljs) . I would of course use it to investigate an issue, but I'll let you play with it a bit more, since you know it better.

tolitius23:01:34

I feel like, in cljs, it could address both issues above, especially during full page reloads / sending large recompiled increments (by figwheel)