Some code in my application is dependent upon some runtime specified code.  The
problem is quite general, so please forgive my description by way of example. 

I'd like this root component to look up dependent components in map.

(q/defcomponent Root
  "The root of the application"
  [state]
  (let [current-view (:current-view state)
        Main (current-view registry/components)]
    (d/div {}
           (Main (current-view state)))))

----

(ns project.component_registry)

(def components {})

(defn register-component 
  [component resource-name]
  (assoc components resource-name component))


Included modules would register themselves:


(ns project.components.contacts
    (:require [project.component_registry :refer [register-component]]))

(declare Contacts) ;; some quiescent component defined here 

(register-component Contacts :contacts)


I can see how I would specify dependencies with the newly supported
Google Closure `:module` option, however I'm using Figwheel during development,
which requires `:optimizations :none`.

Can someone recommend how I might achieve this, or suggest a better approach? 
Also, is this question more suited to StackOverflow?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to