diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn new file mode 100644 index 0000000..ce36d03 --- /dev/null +++ b/.clj-kondo/config.edn @@ -0,0 +1 @@ +{:config-paths ["../resources/clj-kondo.exports/functionalbytes/mount-lite"]} diff --git a/.gitignore b/.gitignore index fd088bf..54f22ad 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,4 @@ pom.xml.asc .hg/ /mount-lite.iml .idea/ -/.lsp -/.clj-kondo/* -/!.clj-kondo/config.edn +.cache diff --git a/resources/clj-kondo.exports/functionalbytes/mount-lite/hooks/lite.clj b/resources/clj-kondo.exports/functionalbytes/mount-lite/hooks/lite.clj index dbf3f3c..73aedab 100644 --- a/resources/clj-kondo.exports/functionalbytes/mount-lite/hooks/lite.clj +++ b/resources/clj-kondo.exports/functionalbytes/mount-lite/hooks/lite.clj @@ -16,10 +16,10 @@ hmap (exprs-map args)] (when-not (contains? hmap :start) (throw (ex-info "missing :start expression" {}))) - `(def ~name ~hmap))) + `(def ~name (mount.lite/map->State ~hmap)))) (defmacro state [& args] (let [hmap (exprs-map args)] (when-not (contains? hmap :start) (throw (ex-info "missing :start expression" {}))) - hmap)) + `(mount.lite/map->State ~hmap))) diff --git a/src/mount/lite.clj b/src/mount/lite.clj index 678bfec..5977b1d 100644 --- a/src/mount/lite.clj +++ b/src/mount/lite.clj @@ -211,3 +211,9 @@ (stop))))) (.start)) :result p#})) + +(comment + (def x 1) + (defstate foo :start (fn [] x)) + @foo + )