Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thheller committed Feb 20, 2017
1 parent dd61939 commit 27daee7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 0 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
:test-paths
["src/test"]


:profiles
{:dev
{:source-paths
Expand Down
3 changes: 3 additions & 0 deletions src/main/shadow/markup/react/impl/interop.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
(nil? head)
(create-element* type #js {} tail)

(element? head)
(create-element* type #js {} args)

(object? head)
(create-element* type head tail)

Expand Down
8 changes: 8 additions & 0 deletions src/main/shadow/react/component.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@
(defn ~name [props# & children#]
(shadow.react.component/create-element* (deref component#) props# children#))

;; React-interop, some things require access to the component constructor
;; (deffactory my-component ...) @my-component
;; I prefer this over always declaring two vars one for the component one for the factory
(cljs.core/specify! ~name
cljs.core/IDeref
(~'-deref [x#]
(cljs.core/-deref component#)))

(js/goog.object.set ~name "shadow$component" #(deref config#)))))
5 changes: 3 additions & 2 deletions src/main/shadow/vault/store.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
value
)))

(key-check-value! [_ value]
(key-check-value! [key value]
(when value-spec
(when-not (s/valid? value-spec value)
(js/console.warn "INVALID VALUE FOR KEY"
Expand All @@ -65,7 +65,8 @@
([x y]
(and (key? x)
(key? y)
(= :tag x) (:tag y))))
(= (:tag x)
(:tag y)))))

;; ACTIONS

Expand Down

0 comments on commit 27daee7

Please sign in to comment.