Why are multi-methods not working as functions for Reagent/Re-frame?

前端 未结 4 1156
粉色の甜心
粉色の甜心 2021-02-12 12:53

In a small app I\'m building that uses Reagent and Re-frame I\'m using multi-methods to dispatch which page should be shown based on a value in the app state:

(d         


        
4条回答
  •  逝去的感伤
    2021-02-12 13:34

    How about if you instead have a wrapper pages-component function which is a regular function that can be cached by reagent. It would look like this:

    (defn pages-component [state]
      (layout/pages @state))
    

提交回复
热议问题