Skip to content

Instantly share code, notes, and snippets.

@rarous
Last active December 17, 2015 10:39
Show Gist options
  • Select an option

  • Save rarous/5596919 to your computer and use it in GitHub Desktop.

Select an option

Save rarous/5596919 to your computer and use it in GitHub Desktop.
(ns rx-cljs-demo.client
(:use [domina :only [by-id]]))
(def query (by-id "query"))
(def obs (Rx/Observable/fromEvent query "keyup"))
(-> obs
(.map #(.-value query))
(.filter #(> (count %) 3))
(.throttle 500)
(.subscribe
(fn [v] (js/alert v) nil)
(fn [err] (js/alert err) nil)
(fn [] (js/alert "Done"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment