mount

grumplet 2017-04-06T08:34:26.468192Z

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!

tolitius 2017-04-06T19:23:00.623679Z

@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

grumplet 2017-04-06T21:28:13.472178Z

@tolitius. OK thanks for that explanation 🙂

tolitius 2017-04-06T21:41:30.637806Z

@grumplet sure 🙂

oahner 2017-04-06T23:31:12.661931Z

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

oahner 2017-04-06T23:31:28.664039Z

Is that expected?

oahner 2017-04-06T23:35:29.694190Z

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