These are chat archives for ReactiveX/RxJava

Oct 2015
Oct 23 2015 07:59
hi all, how i can handle empty data inside flatMap, here is my code
private Observable<Invoices> getInvoicesObservable(Invoices invoices) {
        return invoices == null || invoices.getInvoices() == null ? Observable.empty()
                : Observable.combineLatest(Observable.just(invoices), Observable.from(invoices.getInvoices())
                .filter(invoice -> invoice.getStatus() == InvoiceStatus.UNPAID)
                .toSortedList(), (Invoices rawInvoice, List<Invoice> invoiceList) -> {
            return rawInvoice;
combileLatest(..,…, getInvoicesObservable)
  • and in case with null data it never ends
Oct 23 2015 09:08
combileLatest wont fire unless it receives at least 1 elements on both sides. You can add a default element with StartWith, or replace Observable.empty() with something else. Also combileLatest wont complete until all preceding observables complete. Perhaps end those on the left?
Oct 23 2015 09:18
firstOrDefault or startWith can help me, thanks
David Stemmer
Oct 23 2015 13:41
this board has really sold me on Gitter
are there any other interesting open source projects with very active gitter boards?