mount

2016-01-23T09:35:46.000525Z

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.

2016-01-23T09:38:16.000526Z

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

2016-01-23T09:38:38.000527Z

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

2016-01-23T09:38:57.000528Z

I am using clojurescript with figwheel.

jrychter 2016-01-23T18:49:41.000529Z

@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.

tolitius 2016-01-23T22:58:07.000002Z

@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).

tolitius 2016-01-23T23:00:54.000003Z

@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.

tolitius 2016-01-23T23:01:13.000004Z

it might make sense to make this behavior configurable: https://github.com/tolitius/mount#recompiling-namespaces-with-running-states

tolitius 2016-01-23T23:02:34.000006Z

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