Skip to content

Commit

Permalink
Avoid defonce
Browse files Browse the repository at this point in the history
It hinders interactive development, while not having a difference in final deliverables.
  • Loading branch information
vemv committed Feb 16, 2022
1 parent 2962e3e commit 9a2c68e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/refactor_nrepl/artifacts.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
(if (zero? lm) nil lm)))

;; structure here is {"prismatic/schem" ["0.1.1" "0.2.0" ...]}
(defonce artifacts (atom (if (.exists (io/file artifacts-file))
(->> artifacts-file slurp edn/read-string (into {}))
{})
:meta {:last-modified
(get-last-modified-from-file artifacts-file)}))
(def artifacts (atom (if (.exists (io/file artifacts-file))
(->> artifacts-file slurp edn/read-string (into {}))
{})
:meta {:last-modified
(get-last-modified-from-file artifacts-file)}))

(def millis-per-day (* 24 60 60 1000))

Expand Down
2 changes: 1 addition & 1 deletion src/refactor_nrepl/ns/libspecs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

;; The structure here is {path {lang [timestamp value]}}
;; where lang is either :clj or :cljs
(defonce ^:private cache (atom {}))
(def ^:private cache (atom {}))

(defn- aliases [libspecs]
(->> libspecs
Expand Down

0 comments on commit 9a2c68e

Please sign in to comment.