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.

688 questions
127
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,240
  • 4
  • 20
  • 24
67
votes
5 answers

How to catch error and continue executing a sequence in RxJs?

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,627
  • 4
  • 23
  • 39
66
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…
adamdport
  • 11,687
  • 14
  • 69
  • 91
52
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…
TooCool
  • 10,598
  • 15
  • 60
  • 85
46
votes
3 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,711
  • 5
  • 21
  • 27
37
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
  • 7,765
  • 26
  • 90
  • 126
28
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
  • 683
  • 1
  • 6
  • 15
27
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
  • 273
  • 1
  • 3
  • 5
23
votes
5 answers

Do I need a StatefulWidget if my app is using bloc?

I'm missing something. I recently watched the talk here, where the flutter devs are going through using the bloc development method with reactivex in Dart. If I'm using these streams and streamBuilders to manage data flowing through my app, and…
Academiphile
  • 1,434
  • 2
  • 13
  • 21
23
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,639
  • 4
  • 40
  • 59
23
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,294
  • 1
  • 14
  • 23
22
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…
Tony Dinh
  • 6,668
  • 5
  • 39
  • 58
21
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?
19
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
  • 4,532
  • 5
  • 31
  • 53
17
votes
1 answer

What is the difference between .subscribe and .drive

I am quite new in Reactive Programming, Here is what I'm trying .drive searchController.rx.text .asDriver() .drive(onNext: { (element) in print(element) }).disposed(by:…
Trool Destroyer
  • 207
  • 3
  • 8
1
2 3
45 46