Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn- munged-symbol
- [& strs]
- (symbol (cljs.compiler/munge (apply str strs))))
- (defmacro observable
- "It is a macro that calls observable-fn we
- need it because we need to call it in compilation
- phase because of namespace resolution , wee need ns mungling
- Accepts name(str) or name and value
- "
- ([name]
- `(observable-fn
- ~(munged-symbol *cljs-ns* "." name)
- nil))
- ([name value]
- `(observable-fn
- ~(munged-symbol *cljs-ns* "." name)
- ~value)))
Advertisement
Add Comment
Please, Sign In to add comment