i've read this thread, seems there no load , load-file in clojurescript. possible separate single namespace on multiple files?
the reason want because i'm using om , want separate components different files. can using separate namespaces, have write same requires in beginning of each file , way call components in main file that:
(:require [some-project.sidebar :as sidebar]) ... (om/build sidebar/sidebar app-state) i.e. have specify namespace before each component's name, doesn't pretty. ideas on how improve it? i'm new clojure , clojurescript, maybe i'm missing obvious?
there few things note here
- you can use :refer in :require import unqualified vars namespace. ok if there few, can unwieldy if tried everything.
- clojure applications structured in tree fashion main namespace requires sub namespaces, , on, won't importing same namespaces every namespace.
- even if possible split namespace across multiple files, wouldn't idiomatic clojure. 1 file = 1 namespace norm.
- if wanted, can def vars 1 namespace make 1 'master' namespace use in other namespaces.
- if want minimise number of imports have do, make fewer namespaces , make them bigger.
Comments
Post a Comment