From 9a2c68e36c116326a64828a24fd11fa806d78be0 Mon Sep 17 00:00:00 2001 From: vemv Date: Wed, 16 Feb 2022 20:31:24 +0100 Subject: [PATCH] Avoid `defonce` It hinders interactive development, while not having a difference in final deliverables. --- src/refactor_nrepl/artifacts.clj | 10 +++++----- src/refactor_nrepl/ns/libspecs.clj | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/refactor_nrepl/artifacts.clj b/src/refactor_nrepl/artifacts.clj index 5442ebff..f61b704b 100644 --- a/src/refactor_nrepl/artifacts.clj +++ b/src/refactor_nrepl/artifacts.clj @@ -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)) diff --git a/src/refactor_nrepl/ns/libspecs.clj b/src/refactor_nrepl/ns/libspecs.clj index 04d61ffb..f3092884 100644 --- a/src/refactor_nrepl/ns/libspecs.clj +++ b/src/refactor_nrepl/ns/libspecs.clj @@ -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