mount icon indicating copy to clipboard operation
mount copied to clipboard

Deref mount state var in :stop function in readme?

Open martinklepsch opened this issue 3 years ago • 1 comments

This could be either a question or a documentation fix. In my nodejs/cljs usage of mount I found that I need to deref the var that I define with defstate in the :stop function. Is this correct and the documentation should be updated?

Could also a difference between Clojure and ClojureScript maybe?

martinklepsch avatar Nov 04 '22 13:11 martinklepsch

a state would only needed to be dereffed "in-cljc-mode" here are some docs with an example on starting / stopping / using the state in this mode.

I can see how the "front page" doc may be misleading if ClojureScript is the only env, which is unusual, but probable :) instead of altering it, we can add a note on a bottom:


(defstate conn :start (create-conn)
               :stop (disconnect conn))

or ":stop (disconnect @conn)" in case of ClojureScript. more cljs docs here


feel free to add it, or I can do it

tolitius avatar Nov 07 '22 17:11 tolitius