Fork me on GitHub
#beginners
<
2016-07-10
>
Tim05:07:40

lein cljsbuild auto?

maxim06:07:12

Could someone explain what's the difference between using vars instead of raw functions when defining routes?

(def app-routes
  (routes
    (-> #'home-routes ;; or home-routes
        (wrap-routes middleware/wrap-csrf)
        (wrap-routes middleware/wrap-formats))))

(defn app [] (middleware/wrap-base #'app-routes)) ;; or app-routes
The code example is taken from Luminus framework

niwinz09:07:41

if you use vars, you can use the "reload" middleware for redefine handlers if the source code is changed

niwinz09:07:54

the reload stuff is done with wrap-reload middleware of ring.