Update defstate clj-kondo hook to return a var
This commit is contained in:
parent
632977ff41
commit
4065f5df36
5 changed files with 13 additions and 8 deletions
1
.clj-kondo/config.edn
Normal file
1
.clj-kondo/config.edn
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{:config-paths ["../resources/clj-kondo.exports/mount/mount/"]}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -21,3 +21,4 @@ doo-index.html
|
||||||
/.nrepl-history
|
/.nrepl-history
|
||||||
.cljs_rhino_repl/
|
.cljs_rhino_repl/
|
||||||
out/
|
out/
|
||||||
|
.clj-kondo/.cache
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
{:lint-as {mount.core/defstate clojure.core/def-catch-all}
|
{:linters {:mount/defstate {:level :warning}}
|
||||||
:linters {:mount/defstate {:level :warning}}
|
:hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate
|
||||||
:hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate}}}
|
mount.core/defstate! hooks.defstate/defstate}}}
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,10 @@
|
||||||
:col (:col (meta n))})
|
:col (:col (meta n))})
|
||||||
:else
|
:else
|
||||||
{:node (api/list-node
|
{:node (api/list-node
|
||||||
(list*
|
(list
|
||||||
(api/token-node 'fn*)
|
(api/token-node 'def)
|
||||||
(api/vector-node [n])
|
|
||||||
n
|
n
|
||||||
args))})))
|
(api/list-node
|
||||||
|
(list*
|
||||||
|
(api/token-node 'do)
|
||||||
|
args))))})))
|
||||||
|
|
@ -6,8 +6,9 @@
|
||||||
(defn entity [conn id]
|
(defn entity [conn id]
|
||||||
(d/entity (d/db conn) id))
|
(d/entity (d/db conn) id))
|
||||||
|
|
||||||
(defn touch [conn results]
|
(defn touch
|
||||||
"takes 'entity ids' results from a query
|
"takes 'entity ids' results from a query
|
||||||
e.g. '#{[272678883689461] [272678883689462] [272678883689459] [272678883689457]}'"
|
e.g. '#{[272678883689461] [272678883689462] [272678883689459] [272678883689457]}'"
|
||||||
|
[conn results]
|
||||||
(let [e (partial entity conn)]
|
(let [e (partial entity conn)]
|
||||||
(map #(-> % first e d/touch) results)))
|
(map #(-> % first e d/touch) results)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue