Skip to content
master
Switch branches/tags
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
Feb 10, 2014
Sep 29, 2013
Sep 27, 2013

README.md

Pump

Note: Pump is deprecated in favor of om.

Pump is ClojureScript bindings for React.

Usage

(ns your.app
  (:require-macros [pump.macros :refer [defr]])
  (:require [pump]))

(defr Component
  :get-initial-state #(identity {:some-value ""})

  [component props state]

  [:div {:class-name "test"} (:some-value @component)])

See defr documentation and an example of usage.

Setting up a project

You will certainly need a react.js file by itself, for example download it from CDNjs, put somewhere locally (i.e. in resources/vendor), and then refer in your :cljsbuild configuration like that:

:cljsbuild
{:builds [{:id "main"
           :source-paths ["cljs"]
           :compiler {:output-to "resources/target/main.js"
                      :foreign-libs [{:file "resources/vendor/react.min.js"
                                      :provides ["React"]}]
                      :optimizations :whitespace}}]}

If you look into cljsbuild internals, you will see that you should be able to use a link instead of downloading file locally. But that didn't work for me.