forked from ReactiveX/RxJava
-
Notifications
You must be signed in to change notification settings - Fork 4
How To Use
benjchristensen edited this page Jan 25, 2013
·
6 revisions
# Hello World!
A requisite "Hello World!" which creates an Observable from a list of Strings, subscribes to the Observable with a function that will print "Hello %!" for each string.
def hello(String[] names) {
Observable.toObservable(names)
.subscribe({ println "Hello " + it + "!"})
}
hello("Ben", "George")
Hello Ben!
Hello George!
(defn hello
[&rest]
(-> (Observable/toObservable &rest)
(.subscribe #(println (str "Hello " % "!")))))
=> (hello ["Ben" "George"])
Hello Ben!
Hello George!
A Netflix Original Production
Tech Blog | Twitter @NetflixOSS | Twitter @RxJava | Jobs