kibit
kibit copied to clipboard
Bad advice for `constantly` anonymous function
Isn't this wrong?
Consider using:
page
instead of:
(fn [] [page])
Shouldn't it be (constantly page)? (or (constantly [page]))?
Can you give the full code context for this?
Sure... It's ClojureScript:
(ns myapp.cc.core
(:require [reagent.core :as reagent :refer [atom]]
[myapp.helper :as h]
[ajax.core :refer [GET]]))
(defn ^:export main []
(init-state)
(reagent/render-component (fn [] [page]) (h/get-elem "app")))
And the definition of myapp.helper/get-elem:
(defn get-elem [id] (goog.dom/getElement id))
I suspect it's related with this issue
https://github.com/jonase/kibit/issues/174
Can't find the rule that defines that equivalence though..