Fork me on GitHub

Hey guys I am a bit stuck. Getting the following error:

Invalid arity: 0 
using with a subscribe. Anyone encountered something similar?


@jarvinenemil Could you show us how you use it?


(defn main-panel
  (let [active-panel (rf/subscribe [::subs/active-panel])]
     :height "100%"
     :children [
                (let [game-popup @(rf/subscribe [::subs/queue-popup])]
                  (infof "Got data %s" game-popup)
                  (if (empty? game-popup)
                                       :backdrop-color   "grey"
                                       :class "play-modal"
                                       :backdrop-opacity 0.4
                                       :child            []]))
                 :children [

                             :children [
                                        (let [user @(rf/subscribe [::subs/user])]
                                          (if (empty? user) nil (side-navigation-bar)))

                                        (condp = @active-panel
                                          :sign-up   [sign-up/sign-up-panel]
                                          :home [home-panel])


I ended up creating my own solution drawing inspiration from @U0J30HBRS :flag-se:


Cool! :flag-se::flag-se::flag-se:


(I put it in the main-panel for the example, I will put it in another component so I don't have to re-render everything later on 🙂)


Does re-frame provide a way to save/read say session info from localStorage or does one handle that themselves?


@sveri Kinda late now but I actually made a library for persisting app-db in local-storage a while back:


Oh @urbanslug maybe you could also check this out, see if it works for you ☝️


Large re-frame application structure We have a pretty large re-frame app (30K LOC), and we’re trying to break it into separate modules that can be lazily loaded. Few problems we run into trying to analyze dependancies (this assumes breaking the app into multiple panels as mentioned here: 1. Events and Subscriptions were not fully qualified keywords so they did not require to require their respective panel subs namespace when being used. 2. Panel ‘Instances’ - Think about the following use case: dashboard with widgets. A user can have the same widget on the dashboard with different configurations. Hence from re-frame code perspective it’s one panel, but this panel has multiple ‘instances’. Each panel instance will have its own key in the app-db. The problem here is how to subscribe to that specific panel instance subscriptions or dispatch that specific instance events. We thought about few solutions but none of them is great. I would love to hear some ideas regarding both issues. @mikethompson I remember you mentioned in Google Groups (long time ago) that your re-frame app uses dashboards with widgets, so I’m believe you had to solve a similar problem.


Can we get the old value and the new value of a reframe subscription ?