daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private fun displayMonsterList(models: List<MonsterModel>) {
  2.         compositeDisposable.add(
  3.                 models.toObservable()
  4.                         .subscribeOn(Schedulers.io())
  5.                         .doOnError { println(it) }
  6.                         .groupBy {
  7.                             it.getName(lang)
  8.                         }
  9.                         .flatmap { mapMonsterGroupToMultiMonster(it) }
  10.                         .observeOn(AndroidSchedulers.mainThread())
  11.                         .subscribeBy {
  12.                             println(it)
  13.                         }
  14.         )
  15.     }
  16.        
  17.     private fun mapMonsterGroupToMultiMonster(group: GroupedObservable<String, MonsterModel>): MultiMonster {
  18.         return Obervable
  19.                .just(MultiMonster())
  20.                .withlatestfrom(group,
  21.                    (result, model) -> {
  22.                      run(...);
  23.                      return result;
  24.                    })
  25.                .lastelement() // ?
  26.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top