Questions tagged [combinelatest]

137 questions
1
vote
2 answers

Recursively sending values to combineLatest publisher

I came across some unexpected behavior in Combine that i'm hoping someone may be able to explain. I would expect the following code to create an infinite loop, but it actually only runs through the stream once. let pub1 = PassthroughSubject
1
vote
2 answers

combineLatest correct syntax

I'm trying to use combineLatest, in particular I need to combine four Observables that emit values of different types with a projection function that returns a boolean type. From what I get from the Rxjs documentation here, I think that this is the…
Lucio Crusca
  • 1,277
  • 3
  • 15
  • 41
1
vote
1 answer

undefined when combine combineLatest and switchMap

I'm trying to combine two Observables to have few values for the call to service method that accepts two values. But here I have few errors Argument of type '([filter, sort]: [string, string]) => void' is not assignable to parameter of type…
1
vote
1 answer

How to use CombineLatest in Rx.NET for 2 different types

I cant work out what the syntax is to combine these two observables, property Configuration and BalanceDtos in Rx.NET, can do it in RxJS no problem (example below), any ideas? This is as close as I can get it, but its not correct. public…
Joe Pinder
  • 41
  • 1
  • 4
1
vote
3 answers

RXSwift ObservableCollection with CombineLatest

I am trying to implement something like this, let api1 = Observable.of(["documents"]) //Replace with observable to download docs let api2 = Observable.of(["applications"]) //Replace with observable to download apps let api3 =…
Easy Coder
  • 295
  • 1
  • 3
  • 14
1
vote
1 answer

How to combine multiple subjects into one and react to every change

I am currently building a stepper component which has multiple step components rendered in its ng-content. In the stepper component i am accessing these components via ContentChildren. Each step component has a Subject which calls .next() when an…
Patrick
  • 349
  • 1
  • 7
  • 15
1
vote
2 answers

RxJs - Combine two observables, result selector function, zip

I'm working on some legacy code and there is a issue with wrong status updates of the device. Problem is, that the old - legacy state update is done using long polling and it has concurrency issues on the BE which won't be fixed (BE deprecated).…
mat.hudak
  • 2,803
  • 2
  • 24
  • 39
1
vote
1 answer

Combine combineLatest is not waiting for the previous operation to fire

If you try this code in Playgroud: import Combine import Foundation struct User { let name: String } private var subscriptions = Set() var didAlreadyImportUsers = false var users = [User]() func importUsers() -> Future
iOSGeek
  • 5,115
  • 9
  • 46
  • 74
1
vote
2 answers

How to use combineLatest with filter in certain observable?

This is a simplification of a complex case, where some observables in array could be filtered if the values are not valid. The problem is that the filtered observable is not allowing to the other complete the combine. What operator or approach could…
Tabares
  • 4,083
  • 5
  • 40
  • 47
1
vote
1 answer

Managing multiple RxJs Observables on a component

Below is a code snippet of a component in my application where I subscribe to multiple observables and load data [an api call] after I get values respectively. ngOnInit() { this.combinedObservable$ = combineLatest( …
user1375481
  • 309
  • 1
  • 8
  • 19
1
vote
1 answer

Rxdart combinelaststream function does not work

I am going to combine two stream. But it does not work. What is my mistake ? My build function is ; @override Widget build(BuildContext context) { return StreamBuilder( stream: Observable.combineLatest2( …
Zarma Mokana
  • 71
  • 2
  • 10
1
vote
1 answer

CombineLatest in Combine is not fired

let a = Just("a") let b = Just("b") _ = Publishers.CombineLatest(a, b).map { a, b in print(a, b) } This is my simple CombineLatest test. I am calling this method in onAppear function. However, my print(a,b) is not called. How should I fix my…
jonye._.jin
  • 591
  • 1
  • 5
  • 17
1
vote
1 answer

Cannot invoke 'filter' with an argument list of type '(@escaping (_) -> _)' within combineLatest in RxSwift

I am trying to filter out something from two streams I'm trying to combine. Both values that I am trying to are of the same type so I can't seem to understand why I am getting this issue. let currentUserEmail = Observable.just(currentUserEmail) …
Sara
  • 103
  • 1
  • 13
1
vote
1 answer

Mistake in WWDC 2019 "Combine in Practice" Code example for CombineLatest?

I tried to follow the code snippet of WWDC 2019's Combine in Practice talk (starting at minute 26:00) or see slides 179 ff. but it won't compile and looking at the API some parts don't make sense to me (e.g., calling CombineLatest.init(A, B) with a…
Christopher Graf
  • 1,929
  • 1
  • 17
  • 34
1
vote
1 answer

RxSwift Combining heterogeneous observables

I have two objects Chat and messages both in Realm database. I am fetching from db and getting two observables. Message object have chatId through which I can get chat object. chats() - gives Observable<[Chat> messages() - gives…
Ankur Prakash
  • 1,417
  • 4
  • 18
  • 31