rakeeb
02/13/2018, 2:53 PMdamian
02/23/2018, 2:05 PMtimeLeft
in seconds). my first approach was combineLatest(state, Observable.interval(1, TimeUnit.SECONDS))
but the timer seems to start before i even receive a state, thus my countdown is wrong. my next approach would be state.switchMap { state -> Observable.interval(1, TimeUnit.SECONDS). map { elapsedTime -> state.timeLeft - elapsedTime}}
- is there a “better” approach to this?kluck
02/23/2018, 2:48 PMrudolf.hladik
02/26/2018, 8:38 AMlexardi
03/05/2018, 11:07 AMif (disposable != null) dispose()
in every onDestroy().
How to facilitate this process?edwardwongtl
03/05/2018, 11:11 AMcompositeDisposable
to hold all disposable
in a single place.ubu
03/07/2018, 6:02 PMlocke
03/13/2018, 2:21 PMmap
the BehaviorSubject
? Not trying to argue, but the above does allow values to be pushed into it? I'm not quite sure what you mean by the alternative solution.
The general goal is to have this Subject
observer listen to values of this List
, and emit filtered
versions of the List
. New to Rx, so maybe I have the structure of the way this should work setup incorrectly. It was my understanding that Subjects
act as both Observer
and Observable
.adams2
03/14/2018, 11:08 PMjw
03/20/2018, 8:11 PMupstream.publish { zip(it, it.skip(1), it.skip(2), ::Tuple) }
edwardwongtl
03/21/2018, 5:35 AMgetItems().first(default).map{ it.isNotEmpty() }
should do the trickgildor
04/05/2018, 11:31 AMjw
04/06/2018, 2:17 AMreturn parents.flatMapIterable { it }
.concatMap { parent -> Single.zip(getFirst(parent), getSecond(parent), { first, second -> parent.copy(first = first, second = second) }) }
.toList()
jw
04/06/2018, 2:18 AMvander2675
04/09/2018, 7:56 AMubu
04/09/2018, 12:02 PMstate1 -> state2 -> state1 -> state2 -> state1 -> state2 -> ...
When there’s no event within 3 seconds, restore default state (state1). How would I do that?
Any help would be appreciated.ursus
04/14/2018, 3:40 AMBiFunction { user: User, token: String -> Tuple2(user, token) }
in rx with kotlin?ursus
04/14/2018, 3:55 AMubu
04/17/2018, 6:44 PMRxView.clicks(someButton)
), what would be the best way to unsubscribe/disable all other buttons when ButtonX is pressed?ursus
04/18/2018, 3:14 AMGurpreetSK
04/18/2018, 6:29 PMsingle
if it is empty? For example, I have my DB call returning a single and want to return a boolean value on basis of whether it is empty or not. I'm doing the following currently, but it doesn't seem to work as the control gets blocked (as the table is empty).
myDao
.getAll(object.id())
.isEmpty
.blockingGet()
.not()
ursus
04/18/2018, 7:48 PMdknapp
04/18/2018, 8:58 PMedwardwongtl
04/20/2018, 3:41 AMonErrorResumeNext { t: Throwable -> ... }
jw
04/20/2018, 7:58 PMPaul Woitaschek
04/23/2018, 9:47 AMexecuteRequest
a couple of times and you're into the fun 🙂jw
04/27/2018, 5:31 PM.publish().refCount()
blakelee
04/27/2018, 11:17 PMprivate var id = 1
private val getItem: Observable<Any> =
service.getItem(id) // a Single
.toObservable()
.repeatWhen { completed -> completed.delay(3, TimeUnit.SECONDS) }
.share()
Slackbot
05/02/2018, 6:38 AMursus
05/03/2018, 1:09 PMursus
05/03/2018, 1:09 PMPandu
05/03/2018, 10:48 PMursus
05/05/2018, 9:34 PM