Here is short snippet of code:
val subject = BehaviorSubject.createDefault(emptyList<Int>())
subject.onNext(Arrays.asList(1, 2, 3))
subject.flatMapIterable { list: List<Int> -> list }
.subscribeBy(
onNext = { l("on next", it) },
onComplete = { l("on complete") }
)
Why onComplete
doesn't not call here? What I should do for working this code? Because in original code I can not use .toList()
method.