Skip to content

Latest commit

 

History

History
 
 

cyclops-rx

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

RxJava Integration

v8.0.0 of cyclops-rx and above is built using v1.1.3 of RxJava

Get cyclops-rx

cyclops-rx features include

  1. Native for comprehensions for RxJava Observables
  2. Native Monad Tranformer for Observable. ObservableT also has native for comprehensions
  3. Monad wrapping via AnyM / AnyMValue / AnyMSeq
  4. Compatible with cyclops-react pattern matching
  5. Ability to use Observables inside cyclops-react monad transformers (as the wrapping type, requires conversion to act as the nested type).

Use Rx.observable to create wrapped RxJava Monads.

Example for comprehensions with Observable

Observable<Integer> result = RxCyclops.ForObservable.each2(Obserbable.just(10,20),a->Observable.<Integer>just(a+10),(a,b)->a+b);
	
//Observable[30,50]

observableT monad transformer

StreamTSeq<Integer> nested = RxCyclops.observableT(ReactiveSeq.of(Observable.just(1,2,3),Observable.just(10,20,30)));
StreamTSeq<Integer> mapped = nested.map(i->i*3);

//mapped = [ReactiveSeq[ReactiveSeq[3,6,9],ReactiveSeq[30,60,90]]