Permalink
Browse files

Add Om

  • Loading branch information...
jraines committed Nov 3, 2015
1 parent 8e70c14 commit ab0150afafdfe3b305270d6a8e8977f7fedf8985
Showing with 13 additions and 9 deletions.
  1. +1 −0 project.clj
  2. +0 −2 resources/public/index.html
  3. +12 −7 src/simoutfit/core.cljs
View
@@ -8,6 +8,7 @@
[org.clojure/clojurescript "1.7.122"]
[compojure "1.4.0"]
[http-kit "2.1.19"]
+ [org.omcljs/om "1.0.0-alpha14"]
[com.cognitect/transit-clj "0.8.285"]
[com.cognitect/transit-cljs "0.8.225"]
[figwheel "0.5.0-SNAPSHOT"]
@@ -7,8 +7,6 @@
</head>
<body>
<div id="app">
- <h2>Figwheel template</h2>
- <p>Checkout your developer console.</p>
</div>
<script src="js/compiled/simoutfit.js" type="text/javascript"></script>
</body>
View
@@ -1,12 +1,21 @@
(ns ^:figwheel-always simoutfit.core
- (:require [cognitect.transit :as t])
+ (:require [cognitect.transit :as t]
+ [goog.dom :as gdom]
+ [om.next :as om :refer-macros [defui]]
+ [om.dom :as dom])
(:import [goog.net XhrIo]))
(enable-console-print!)
-(println "Edits to this text should show up in your developer console.")
+(defui HelloWorld
+ Object
+ (render [this]
+ (dom/div nil "Hello, world!")))
+
+(def hello (om/factory HelloWorld))
+
+(js/ReactDOM.render (hello) (gdom/getElement "app"))
-;; define your app data so that it doesn't get over-written on reload
(def r (t/reader :json))
@@ -22,10 +31,6 @@
(println (t/read r res))))
-
-(defonce app-state (atom {:text "Hello world!!!"}))
-
-
(defn on-js-reload []
(println "Reloaded!")
;; optionally touch your app-state to force rerendering depending on

0 comments on commit ab0150a

Please sign in to comment.