Created
September 8, 2012 20:53
-
-
Save cstorey/3679640 to your computer and use it in GitHub Desktop.
Using Flapjax in ClojureScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Flapjax Demo: Time 1</title> | |
</head> | |
<p>The time is <span class="fixedBlock"><span id="timer">not initialized</span></span>.</p> | |
<p>The time in seconds is <span class="fixedBlock"><span id="timer2">not initialized</span></span>.</p> | |
<script type="text/javascript" src="main.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject fjaxexamples "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.4.0"]] | |
:plugins [[lein-cljsbuild "0.2.7"]] | |
:cljsbuild { | |
:builds {:main {:source-path "src-cljs" | |
:compiler {:output-to "resources/public/main.js" | |
:optimizations :whitespace | |
:pretty-print true | |
;; This file comes from https://github.com/brownplt/flapjax/blob/master/src/flapjax.js | |
:libs ["resources/public/flapjax.js"] }}}} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns time | |
(:require [F])) | |
(def timeB (F/timerB 100)) | |
(F/insertDomB timeB "timer") | |
(def secondB (F/liftB #(Math/floor (/ % 1000)) timeB)) | |
(F/insertDomB secondB "timer2") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment