Functions an macros for instantiating rx Func* and Action* interfaces.
Functions an macros for instantiating rx Func* and Action* interfaces.
(action & fn-form)
Like clojure.core/fn, but returns the appropriate rx.functions.Action* interface.
Example:
(.finallyDo my-observable (rx/action [] (println "Finally!")))
Like clojure.core/fn, but returns the appropriate rx.functions.Action* interface. Example: (.finallyDo my-observable (rx/action [] (println "Finally!")))
(action* f)
Given function f, returns an object that implements rx.functions.Action0-3 by delegating to the given function. Also implements rx.Observable$OnSubscribe which is just an Action1.
Example:
(.subscribe my-observable (rx/action* println))
See: http://netflix.github.io/RxJava/javadoc/rx/functions/Action0.html
Given function f, returns an object that implements rx.functions.Action0-3 by delegating to the given function. Also implements rx.Observable$OnSubscribe which is just an Action1. Example: (.subscribe my-observable (rx/action* println)) See: http://netflix.github.io/RxJava/javadoc/rx/functions/Action0.html
(fn & fn-form)
Like clojure.core/fn, but returns the appropriate rx.functions.Func* interface.
Example:
(.map my-observable (rx/fn [a] (* 2 a)))
or, to create an Observable:
(Observable/create (rx/fn [observer] (.onNext observer 10) (.onCompleted observer) (Subscriptions/empty)))
See: rx.lang.clojure.interop/fn*
Like clojure.core/fn, but returns the appropriate rx.functions.Func* interface. Example: (.map my-observable (rx/fn [a] (* 2 a))) or, to create an Observable: (Observable/create (rx/fn [observer] (.onNext observer 10) (.onCompleted observer) (Subscriptions/empty))) See: rx.lang.clojure.interop/fn*
(fn* f)
Given function f, returns an object that implements rx.functions.Func0-9 by delegating the call() method to the given function.
If the f has the wrong arity, an ArityException will be thrown at runtime.
This will also implement rx.Observable$OnSubscribeFunc.onSubscribe for use with Observable/create. In this case, the function must take an Observable as its single argument and return a subscription object.
Example:
(.reduce my-numbers (rx/fn* +))
See: http://netflix.github.io/RxJava/javadoc/rx/functions/Func0.html
Given function f, returns an object that implements rx.functions.Func0-9 by delegating the call() method to the given function. If the f has the wrong arity, an ArityException will be thrown at runtime. This will also implement rx.Observable$OnSubscribeFunc.onSubscribe for use with Observable/create. In this case, the function must take an Observable as its single argument and return a subscription object. Example: (.reduce my-numbers (rx/fn* +)) See: http://netflix.github.io/RxJava/javadoc/rx/functions/Func0.html
(fnN* f)
Given function f, returns an object that implements rx.functions.FuncN by delegating to the given function.
Unfortunately, this can't be included in fn* because of ambiguities between the single arg call() method and the var args call method.
See: http://netflix.github.io/RxJava/javadoc/rx/functions/FuncN.html
Given function f, returns an object that implements rx.functions.FuncN by delegating to the given function. Unfortunately, this can't be included in fn* because of ambiguities between the single arg call() method and the var args call method. See: http://netflix.github.io/RxJava/javadoc/rx/functions/FuncN.html
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close