All Projects → piranha → Pump

piranha / Pump

Licence: epl-1.0
Pump your REACTive app with fuel

Programming Languages

javascript
184084 projects - #8 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].