I am trying to merge multiple publishers that are of different types.
I have publishers of type string and a publisher of type, however when I merge them using MergeMany or CombineLatest I get a type mismatch error.
Is there anyway to merge publishers of different types? See the code example below:
@Published var str1: String?
@Published var str2: String?
@Published var image: Image?
Publishers.MergeMany($str1, $str2, $image)
.removeDuplicates()
.sink { _ in
//...
}
.store(in: &bag)