fix missing wrap-dynamic-nav in cljs
This commit is contained in:
parent
f8d3ad5167
commit
39e8c758fc
1 changed files with 13 additions and 14 deletions
|
|
@ -23,6 +23,19 @@
|
|||
#?(:clj [com.rpl.specter.macros :as macros])
|
||||
[clojure.set :as set]))
|
||||
|
||||
(defn- static-path? [path]
|
||||
(if (sequential? path)
|
||||
(every? static-path? path)
|
||||
(-> path i/dynamic-param? not)
|
||||
))
|
||||
|
||||
(defn wrap-dynamic-nav [f]
|
||||
(fn [& args]
|
||||
(let [ret (apply f args)]
|
||||
(if (and (sequential? ret) (static-path? ret))
|
||||
(i/comp-paths* ret)
|
||||
ret
|
||||
))))
|
||||
|
||||
#?(:clj
|
||||
(do
|
||||
|
|
@ -114,20 +127,6 @@
|
|||
attr)]
|
||||
[(with-meta name attr) macro-args]))
|
||||
|
||||
(defn- static-path? [path]
|
||||
(if (sequential? path)
|
||||
(every? static-path? path)
|
||||
(-> path i/dynamic-param? not)
|
||||
))
|
||||
|
||||
(defn wrap-dynamic-nav [f]
|
||||
(fn [& args]
|
||||
(let [ret (apply f args)]
|
||||
(if (and (sequential? ret) (static-path? ret))
|
||||
(i/comp-paths* ret)
|
||||
ret
|
||||
))))
|
||||
|
||||
(defmacro dynamicnav [& args]
|
||||
`(vary-meta (wrap-dynamic-nav (fn ~@args)) assoc :dynamicnav true))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue