Fork me on GitHub
#mount
<
2017-04-06
>
grumplet08:04:26

Quick question: Does it make sense to use mount in a figwheel environment? If so, how do mount start and stop play with figwheel’s recommended use of defonce? Probably a stupid question, I know!

tolitius19:04:00

@grumplet I mostly use https://github.com/adzerk-oss/boot-reload but as far as figwheel goes, whenever the page / namespace reloads, mount would stop/start (i.e. restart) corresponding states. for example, in case you have a web socket connection, and you changed a namespace where this connection is defined, mount will reconnect on reload. In case you load something from the server and keep it within a mount state, mount will reload it in case a namespace (that state belongs to) is reloaded. there are also options to suggest mount not to restart / reload certain states: https://github.com/tolitius/mount#recompiling-namespaces-with-running-states

grumplet21:04:13

@tolitius. OK thanks for that explanation 🙂

oahner23:04:12

I'm a bit confused about :on-reload :noop, when I reload a namespace with a noop state in it, it seems mount/stop forgets about it

oahner23:04:28

Is that expected?

oahner23:04:29

By that I mean, it doesn't get stopped and started on the reload, as expected, but then after that, when I actually call mount/stop, it already shows up as stopped, even though it's still running, and the next mount/start fails since the port is already bound