Questions tagged [behaviorrelay]
8 questions
11
votes
2 answers
RxSwift: What is the usage difference between BehaviorSubject and BehaviorRelay?
I am aware that BehaviorRelay is replacing Variable, and both BehaviorSubject and BehaviorRelay starts with an initial value, and replays it or the latest value to the subscribers.
What are the differences then? in which case you would use one over…

Alan Steiman
- 412
- 1
- 4
- 14
4
votes
1 answer
How do you edit a property of the current value inside a BehaviorRelay?
I'm very new to RxSwift and RxCocoa and I've recently made heavy use of Variable because of how convenient it is to just push mutations into the Variable through its value. Now that it is deprecated I'm trying to understand how best to use…

Aaron
- 7,055
- 2
- 38
- 53
2
votes
0 answers
Observable which is Observing BehaviorRelay Only calling for once. RxSwift
I have A parentView which holds two different CollectionViwes. Each view is getting populated from dataBase by passing data to Observable using BehaviorRelay. Everything is working fine until I have to update Views in collection_view_2 from…

Chalenger
- 65
- 1
- 12
1
vote
1 answer
How to typecast NSManagedObject class to Any to create a BehaviorRelay object in RxSwift?
I have an Entity called 'CartItem' (NSManagedObject class) in my coredata datamodelid. Wanted to change Variable to BehaviorRelay in RxSwift, but I get a compile time error stating "[Any] is not convertible to CartItem". How do I change Variable to…

Deepak Thakur
- 3,453
- 2
- 37
- 65
0
votes
1 answer
RxSwift modelSelected Drive model on model View & Get that model on DetailView
This is my FirstView ( Parent VIew)
tableView.rx.modelSelected(Kinder.self)
.asDriver()
.drive(self.detailKinderViewModel.currentKinder)
.disposed(by: disposeBag)
This is ViewModel ( BehaviorRelay )
lazy var…

PotatoLife
- 3
- 1
0
votes
1 answer
Rx BehaviorRelay doesnt keep the data when return from a view
I have an app that have 3 views and a service logic layer. The services is sending messagings all the time to all this views.What I do to control all this data was use RxBehaviorRelay.
To this point all works great, I match the variables with the…

dieroste
- 394
- 1
- 3
- 15
0
votes
1 answer
RxSwift: Stop compactMap to continue executing
I have implemented compactMap over BehaviorRelay and it works just fine:
class MyClass{
let subject = BehaviorRelay(value: 1)
func doSomething() {
subject.compactMap{ $0 }.subscribe(onNext:{
print($0)
…

user2924482
- 8,380
- 23
- 89
- 173
0
votes
1 answer
RxSwift: compactMap never executed
I'm trying to implement compactMap on RxSwift but it seems like is never executed.
Here is my code:
class MyClass{
var disposeBag = DisposeBag()
let subject = BehaviorRelay(value: 1)
func doSomething() {
…

user2924482
- 8,380
- 23
- 89
- 173