These are chat archives for ReactiveX/RxJava

29th
Sep 2017
Viktor Sinelnikov
@asinel
Sep 29 2017 19:53
@akarnokd I see 1 subscriber when subject calls onNext
Also I tried to do a hack:
.flatMap(object: Function<RequiresCaptchaResponse, Observable<String>> {
                    override fun apply(it: RequiresCaptchaResponse): Observable<String> {
                        val subject = PublishSubject.create<String>()
                        if (it.requiresCaptcha) {
                            RxActivityResult.on(activity)
                                    .startIntent(Intent(activity, Recaptcha2Activity::class.java))
                                    .map { it.data().getStringExtra(Recaptcha2Activity.KEY_CAPTCHA_HASH)?:"" }
                                    .subscribe({ subject.onNext(it) })
                            return subject
                        } else {
                            return Observable.just("")
                        }
                    }
                })
.flatMap { api.publishSendIt(id!!, it) }
I am getting a callback in "subsribe", so it 100% calls subject.onNext
But I don't get a call into next flatMap
David Karnok
@akarnokd
Sep 29 2017 21:06
Try ReplaySubject in your hack.
Viktor Sinelnikov
@asinel
Sep 29 2017 21:11
Tried, no success(