re-frame-window-fx icon indicating copy to clipboard operation
re-frame-window-fx copied to clipboard

Warning on compilation

Open mlakewood opened this issue 4 years ago • 1 comments

Hi!

First off thanks for this great library! Was really exactly what I needed.

Currently when I'm compiling im getting the following Warnings

------ WARNING #1 - :non-dynamic-earmuffed-var ---------------------------------
 Resource: district0x/re_frame/window_fx.cljs:14:1
--------------------------------------------------------------------------------
  11 | (s/def ::id any?)
  12 | (s/def ::on-resize-args (s/keys :req-un [::dispatch] :opt-un [::debounce-ms ::id]))
  13 | 
  14 | (def *listeners* (atom {}))
-------^------------------------------------------------------------------------
 *listeners* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *listeners* or change the name
--------------------------------------------------------------------------------
  15 | 
  16 | (defn- setup-listener! [event-type callback id]
  17 |   (let [key (events/listen js/window event-type (if (fn? callback)
  18 |                                                   callback
--------------------------------------------------------------------------------
[:app] Build completed. (596 files, 6 compiled, 1 warnings, 6.38s)

Not a huge issue, but it's kinda noisy.

This is my project.clj -> https://github.com/mlakewood/text-to-wardley/blob/main/project.clj

Im not sure if this is actually dynamic, or it just looks like it is given its an atom. Anyway any help would be great, or if you could point me in the right direction, if this is just a matter or renaming would be happy to do a PR.

Thanks again

Mark

mlakewood avatar Apr 05 '21 17:04 mlakewood

I encountered the same warning message, so I guess need to update line 14 to

(def ^:dynamic *listeners* (atom {}))

?

P233 avatar Jun 30 '21 16:06 P233