A ClojureScript wrapper for Reactive Extensions (Rx) for Javascript.
The aim of this wrapper is to let developers write this:
(defn project-range [n]
(return-value (range n)))
(-> (from-array [4 6 8])
(select-many project-range)
(subscribe #(.log js/console (clj->js %))))
Instead of:
(defn project-range [n]
(.returnValue js/Rx.Observable (range n)))
(-> (.fromArray js/Rx.Observable
(clj->js [1 2 3]))
(.selectMany project-range)
(.subscribe #(.log js/console (clj->js %))))
Be warned: it's very early days and this wrapper is still very much incomplete.
For the brave amongst you, add this to your project.clj
:
[com.leonardoborges/rx-cljs "0.0.2-SNAPSHOT"]
Or if you're using maven:
<dependency>
<groupId>com.leonardoborges</groupId>
<artifactId>rx-cljs</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
For a sample app that uses this wrapper, check out this repository.
- create
- return-value
- from-array
- interval
- take
- map
- reduce
- skip
- zip
- select-many
- subscribe
- start-with
- buffer-with-count
- publish
- connect
- ref-count
- on-next
- on-completed
- dispose
From the project root:
$ lein cljsbuild test
Everything else. (but mainly other arities of functions already in here.)
Bug reports and pull requests are much welcome. If submitting code, please add a test to it.
Copyright (C) 2013 Leonardo Borges
Distributed under the Eclipse Public License, the same as Clojure.