.ignoreElements() Change return type Observable<Never> [RxSwift] - TagMerge

.ignoreElements() Change return type Observable<Never> [RxSwift]

YoungminahAsked 7 months ago

Short description of the issue:

I am trying to use .ignoreElements() method due to I have a method returning a Observable<Type> and I wanna transform this into Completable trait but .ignoreElements() return RxSwift.Observable<Never>.

Expected outcome:

I have been looking for another Rx implementations and this method return Completable. I think this make sense because I just want onComplete or onError event .

What actually happens:

The method is currently returning RxSwift.Observable.

Self contained code example that reproduces the issue:

import Foundation
import RxSwift
import RxCocoa

class ExampleError{
    func attempt() -> Completable {
        let subject = PublishSubject<Void>()
        return subject.ignoreElements() //Here goes Error
    }
}

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

6.2.0

Platform/Environment

  • [ ✔️ ] iOS
  • [ ] macOS
  • [ ] tvOS
  • [ ] watchOS
  • [ ] playgrounds

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

  • [✔️ ] easy, 100% repro
  • [ ] sometimes, 10%-100%
  • [ ] hard, 2% - 10%
  • [ ] extremely hard, %0 - 2%

Xcode version:

13.0

:warning: Fields below are optional for general issues or in case those questions aren't related to your issue, but filling them out will increase the chances of getting your issue resolved. :warning:

Installation method:

  • [✔️ ] CocoaPods
  • [ ] Carthage
  • [ ] Git submodules

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

  • [ ] yes (which ones)
  • [ ✔️ ] no

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

  • [ ✔️ ] just starting
  • [ ] I have a small code base
  • [ ] I have a significant code base

Source: link

freak4pcAnswered 7 months ago

Observable<Never> has asCompletable() that should get you there.

Recent Issues

    Programming Languages