Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在与Noir合作,但我不知道如何将信息传递给views. 现在我有一个ref在proj.core/my-ref工作线程中更新的其中。我需要ref从defpage位于创建的视图中访问 的值proj.views.my-view。
views
ref
proj.core/my-ref
defpage
proj.views.my-view
分享这个的惯用方式是ref什么?我正在考虑以某种方式将其传递给闭包,但我不知道这将如何与 noir 拉入视图的方式一起工作
(noir.server/load-views-ns 'proj.views)
将 ref 移动到它自己的命名空间,然后在 proj.views 中只需要 proj.core,例如:
(ns proj.views (:require proj.model)) (defpage "/foo" [] (@proj.model/my-ref)