I am getting error Cannot convert return expression of type 'PrimitiveSequence' to return type 'Observable'
a Single returns PrimitiveSequence, so how can I convert it to Observable of type String?
return Single<String>.create(subscribe: { (single) in
single(.success("test"))
return Disposables.create { }
})
What is right way - I have an API which will return String - say Token.
Just tack on .asObservable()
...
func foo() -> Observable<String> {
return Single<String>.create(subscribe: { (single) in
single(.success("test"))
return Disposables.create { }
}).asObservable()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With