Skip to content

Commit

Permalink
reduce unnecessary calling; alpha release
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Aug 4, 2019
1 parent fcc5c23 commit bd45808
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 120 deletions.
156 changes: 59 additions & 97 deletions calcit.edn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion meyvn.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{:pom {:group-id "respo",
:artifact-id "reacher",
:version "0.2.1",
:version "0.2.2-a1",
:name "Very simple React.js binding in ClojureScript"}
:packaging {:jar {:enabled true
:remote-repository {:id "clojars"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"license": "MIT",
"devDependencies": {
"http-server": "^0.11.1",
"shadow-cljs": "^2.8.41"
"shadow-cljs": "^2.8.42"
},
"dependencies": {
"react": "^16.8.6",
Expand Down
3 changes: 1 addition & 2 deletions src/reacher/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
(defn map-upper-case [m]
(->> m (medley/map-keys (fn [k] (keyword (dashed->camel (name k)))))))

(defn react-create-element [el props & children]
(apply (partial React/createElement el props) children))
(def react-create-element React/createElement)

(defn transform-props [props]
(let [result (-> (map-upper-case props) (update :style map-upper-case))]
Expand Down
12 changes: 5 additions & 7 deletions src/reacher/example/comp/container.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@
(let [tasks (j/get props :tasks)]
(div
{}
(apply
array
(->> tasks
(sort-by (fn [[k task]] (unchecked-negate (:time task))))
(map
(fn [[k task]]
(React/createElement comp-task (j/obj :task task :key (:id task))))))))))
(->> tasks
(sort-by (fn [[k task]] (unchecked-negate (:time task))))
(map
(fn [[k task]]
(React/createElement comp-task (j/obj :task task :key (:id task)))))))))

(defn comp-container [props]
(let [store (j/get props :store)]
Expand Down
2 changes: 1 addition & 1 deletion src/reacher/example/page.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{}
(div {:class-name "app"})
(div {:class-name "meson-modal-container"})
(->> (:scripts info) (map (fn [src] (script {:src src, :key src}))) (apply array))))))
(->> (:scripts info) (map (fn [src] (script {:src src, :key src}))))))))

(defn dev-page []
(make-page
Expand Down
22 changes: 11 additions & 11 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd45808

Please sign in to comment.