Questions tagged [reactivex]

ReactiveX is a library for composing asynchronous and event-based programs by using observable sequences.

From reactivex.io:

It extends the observer pattern to support sequences of data and/or events and adds operators that allow you to compose sequences together declaratively while abstracting away concerns about things like low-level threading, synchronization, thread-safety, concurrent data structures, and non-blocking I/O.

647 questions
121
votes
5 answers

Why are Subjects not recommended in .NET Reactive Extensions?

I am currently getting to grips with the Reactive Extensions framework for .NET and I am working my way through the various introduction resources I've found (mainly http://www.introtorx.com) Our application involves a number of hardware interfaces…
Anthony
  • 2,149
  • 4
  • 17
  • 24
58
votes
4 answers

RxJs catch error and continue

I have a list of items to parse, but the parsing of one of them can fail. What is the "Rx-Way" to catch error but continue executing the sequence Code Sample: var observable = Rx.Observable.from([0,1,2,3,4,5]) .map( function(value){ …
Cheborra
  • 2,557
  • 4
  • 21
  • 38
39
votes
4 answers

BehaviorSubject vs PublishSubject

I'm trying to get my head around the golden rule (if any) about: When to use BehaviorSubject ? and When to use PublishSubject ? The difference between them is very clear There are many kinds of subjects. For this specific requirement, a…
Cool
  • 10,038
  • 13
  • 56
  • 77
36
votes
4 answers

How do I make an Observable Interval start immediately without a delay?

I want my observable to fire immediately, and again every second. interval will not fire immediately. I found this question which suggested using startWith, which DOES fire immediately, but I then get a duplicate first entry. …
adamdport
  • 8,779
  • 11
  • 58
  • 83
35
votes
2 answers

Difference between audit and debounce in RxJS?

I am reading the official documentation of RxJS and then I realized they both are doing exactly the same thing. To me they both seem exactly similar. Please point out the difference between them if there is any at all.
Godfather
  • 5,021
  • 5
  • 19
  • 27
33
votes
3 answers

Difference between Observable.defer and Observable.create in java rx

Can someone explain me the difference between defer and create methods in Observable? I failed to understand when I should use defer and when should I use create .. REFERENCES: Defer: http://reactivex.io/documentation/operators/defer.html Create:…
Xitrum
  • 6,893
  • 21
  • 78
  • 115
24
votes
3 answers

Observing UITextField.editing with RxSwift

I want to observe the property UITextfield.editing. I'm using this code: self.money.rx_observe(Bool.self, "editing").subscribeNext { (value) in print("") }.addDisposableTo(disposeBag) But in the process of running, it's only performed once. How…
C.liu
  • 243
  • 1
  • 2
  • 5
21
votes
2 answers

RXJS: Aggregated debounce

My use case is as following: I get events, which sometimes happen in bursts. If a burst occurs, I only need to handle it once though. Debounce does this. However, debounce only gives me the last element of a burst, but I need to know about all…
Seba Kerckhof
  • 1,224
  • 1
  • 12
  • 21
20
votes
5 answers

Is there a preferred type for an Observable with no need for a value in Next events?

I have an Observable which is only used for triggering flatMap/map. So I only ever need the Next event and never a value. I could use my own concept for such a trash value, but I'm wondering if there's an RxSwift convention for it. Here's what I'm…
solidcell
  • 7,067
  • 3
  • 34
  • 56
20
votes
4 answers

How can I complete Observable in RxJS

Let's say we have an Observable: var observable = Rx.Observable .fromEvent(document.getElementById('emitter'), 'click'); How can I make it Complete (what will trigger onComplete event for all subscribed Observers) ?
ulfryk
  • 573
  • 1
  • 4
  • 14
18
votes
3 answers

Using Consumer interface of Reactivex

I'm new to ReactiveX. I was learning it from reading source-code. Everything was so clear but suddenly I got this word named "Consumer" which was an Interface. It was used in place of Observer. Can someone let me know what it exactly does? I…
Abhishek Kumar
  • 2,792
  • 3
  • 17
  • 34
18
votes
2 answers

Is ReactiveX considered reactive programming?

From ReactiveX introduction page: It is sometimes called “functional reactive programming” but this is a misnomer. ReactiveX may be functional, and it may be reactive, but “functional reactive programming” is a different animal. One main point of…
TrungDQ
  • 6,286
  • 3
  • 31
  • 54
17
votes
1 answer

RxJava 2.0 - How to convert Observable to Publisher

How to convert Observable to Publisher in RxJava version 2? In the first version we have the https://github.com/ReactiveX/RxJavaReactiveStreams project that do exactly what I need. But How can I do it in RxJava 2?
15
votes
3 answers

Single vs Observable in Java RX

In the new release, reactiveX introduced Single, as a variant of Observable http://reactivex.io/documentation/single.html Which is nice to have since in my current use-case, I have multiple executions, and each of them only returns a single result.…
Xitrum
  • 6,893
  • 21
  • 78
  • 115
14
votes
6 answers

Angular 4: Module not found error regarding RxJs

when building the Angular app I get many of these errors, below is just the first one ERROR in ./~/@reactivex/rxjs/dist/cjs/Rx.js Module not found: Error: Can't resolve './add/operator/filter' in '...\node_modules\@reactivex\rxjs\dist\cjs' @…
1
2 3
43 44