Fork me on GitHub
#cljsrn
<
2018-01-17
>
danielneal10:01:24

@olivergeorge I use the following function

danielneal10:01:25

(defn stop-reframe-warning-on-handler-overwrites!
  "When figwheel reloads, reframe warns on handler overwrites.
   Stop this happening.
   See "
  []
  (let [warn (js/console.warn.bind js/console)
        error (js/console.error.bind js/console)
        ;; need to prettify args otherwise they get
        ;; turned into strings in javascript rather
        ;; than clojurescript and keywords look very
        ;; strange
        prettify-args (fn [args]
                        (string/join (map (fn [arg] (if (nil? arg) "*nil*" (str arg))) args)))]
    (rf.log/set-loggers!
      {:warn (fn [& args]
               (cond
                 (re-find #"re-frame: overwriting" (first args)) nil
                 :else (warn (prettify-args args))))
       :error (fn [& args]
                (error (prettify-args args)))})))

danielneal10:01:47

which just stops those specific warnings

danielneal10:01:19

but I guess there might be a way of doing it in figwheel-bridge too