mirror of
https://github.com/metosin/reitit.git
synced 2025-12-24 02:48:25 +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]
|
||||
(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
|
||||
"Get controller identity given controller and match.
|
||||
|
||||
|
|
@ -19,7 +22,7 @@
|
|||
(assert (not (and identity parameters))
|
||||
"Use either :identity or :parameters for controller, not both.")
|
||||
(when params
|
||||
(js/console.warn "Controller :params is deprecated. Replace with :identity or :parameters option."))
|
||||
@params-warning)
|
||||
(cond
|
||||
parameters
|
||||
(into {} (for [[param-type ks] parameters]
|
||||
|
|
|
|||
Loading…
Reference in a new issue