mirror of
https://github.com/metosin/reitit.git
synced 2026-02-05 11:53:11 +00:00
Only display controller :params deprecating warning once
This commit is contained in:
parent
bcfa7878ea
commit
648c92bef8
1 changed files with 4 additions and 1 deletions
|
|
@ -4,6 +4,9 @@
|
||||||
(defn- pad-same-length [a b]
|
(defn- pad-same-length [a b]
|
||||||
(concat a (take (- (count b) (count a)) (repeat nil))))
|
(concat a (take (- (count b) (count a)) (repeat nil))))
|
||||||
|
|
||||||
|
(def ^:private params-warning
|
||||||
|
(delay (js/console.warn "Reitit-frontend controller :params is deprecated. Replace with :identity or :parameters option.")))
|
||||||
|
|
||||||
(defn get-identity
|
(defn get-identity
|
||||||
"Get controller identity given controller and match.
|
"Get controller identity given controller and match.
|
||||||
|
|
||||||
|
|
@ -19,7 +22,7 @@
|
||||||
(assert (not (and identity parameters))
|
(assert (not (and identity parameters))
|
||||||
"Use either :identity or :parameters for controller, not both.")
|
"Use either :identity or :parameters for controller, not both.")
|
||||||
(when params
|
(when params
|
||||||
(js/console.warn "Controller :params is deprecated. Replace with :identity or :parameters option."))
|
@params-warning)
|
||||||
(cond
|
(cond
|
||||||
parameters
|
parameters
|
||||||
(into {} (for [[param-type ks] parameters]
|
(into {} (for [[param-type ks] parameters]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue