File tree 5 files changed +56
-0
lines changed
5 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ * .log
2
+ target
3
+ resources /public /js /
Original file line number Diff line number Diff line change
1
+ (defproject om-tutorial " 0.1.0-SNAPSHOT"
2
+ :description " My first Om program!"
3
+ :dependencies [[org.clojure/clojure " 1.7.0" ]
4
+ [org.clojure/clojurescript " 1.7.170" ]
5
+ [org.omcljs/om " 1.0.0-alpha22" ]
6
+ [figwheel-sidecar " 0.5.0-SNAPSHOT" :scope " test" ]])
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head lang ="en ">
4
+ < meta charset ="UTF-8 ">
5
+ < title > Om Tutorial!</ title >
6
+ </ head >
7
+ < body >
8
+ < div id ="app "> </ div >
9
+ < script src ="js/main.js "> </ script >
10
+ </ body >
11
+ </ html >
Original file line number Diff line number Diff line change
1
+ (require '[figwheel-sidecar.repl :as r]
2
+ '[figwheel-sidecar.repl-api :as ra])
3
+
4
+ (ra/start-figwheel!
5
+ {:figwheel-options {}
6
+ :build-ids [" dev" ]
7
+ :all-builds
8
+ [{:id " dev"
9
+ :figwheel true
10
+ :source-paths [" src" ]
11
+ :compiler {:main 'om-tutorial.core
12
+ :asset-path " js"
13
+ :output-to " resources/public/js/main.js"
14
+ :output-dir " resources/public/js"
15
+ :verbose true }}]})
16
+
17
+ (ra/cljs-repl )
Original file line number Diff line number Diff line change
1
+ (ns om-tutorial.core
2
+ (:require [goog.dom :as gdom]
3
+ [om.next :as om :refer-macros [defui ]]
4
+ [om.dom :as dom]))
5
+
6
+ (enable-console-print! )
7
+
8
+ (defui HelloWorld
9
+ Object
10
+ (render [this]
11
+ (dom/div nil (get (om/props this) :title ))))
12
+
13
+ (def hello (om/factory HelloWorld))
14
+
15
+ (js/ReactDOM.render
16
+ (apply dom/div nil
17
+ (map #(hello {:title (str " Hello " %)})
18
+ (range 3 )))
19
+ (gdom/getElement " app" ))
You can’t perform that action at this time.
0 commit comments