Passing data in noir views - Clojure

I work with Noir , and I cannot figure out how to pass information into views . Right now I have a ref in proj.core/my-ref , which is updated in the workflow. I need to access the ref value from a view created with defpage located in proj.views.my-view .

What would be the idiomatic way of sharing this ref ? I thought about passing it in close, but I don’t see how this will work with the way noir draws looks

t

 (noir.server/load-views-ns 'proj.views) 
+4
source share
1 answer

Move ref to your own namespace, and then just ask proj.core in your proj.views, for example:

 (ns proj.views (:require proj.model)) (defpage "/foo" [] (@proj.model/my-ref) 
+2
source

Source: https://habr.com/ru/post/1436703/


All Articles