ursus
05/12/2018, 2:25 AMursus
05/12/2018, 2:25 AMursus
05/12/2018, 2:27 AMupstream.flatmap(foo -> timer().map(specialFoo).startWith(foo))
ursus
05/12/2018, 2:27 AMjw
05/12/2018, 2:27 AMursus
05/12/2018, 2:27 AMursus
05/12/2018, 2:28 AMjw
05/12/2018, 2:30 AMupstream.publish(u -> merge(timer().map(specialFoo).takeUntil(u), u.take(1)).retryWhen { true })
or somethingursus
05/12/2018, 2:33 AMursus
05/12/2018, 2:33 AMursus
05/12/2018, 2:35 AMrepeat
?jw
05/12/2018, 2:38 AMursus
05/12/2018, 2:41 AMursus
05/12/2018, 2:41 AMjw
05/12/2018, 2:53 AMursus
05/12/2018, 2:56 AMursus
05/12/2018, 2:56 AMjw
05/12/2018, 4:43 AMliminal
05/13/2018, 12:43 PMaddNoteUseCase.add(note)
returns a Completable
Note(text = note.nodeText)
can throw IllegalArgumentException
. What is the recommended way to handle the error (if it occurs, the error is not caught in onError
since the emission has not occurred? Or should validation be done outside of the Note
constructor?arekolek
05/13/2018, 3:06 PMactions.ofType<Action.AddNote>()
.map { Note(text = it.nodeText) }
.switchMap { note ->
addNoteUseCase.add(note)
.subscribeOn(<http://Schedulers.io|Schedulers.io>())
.toSingleDefault<Change>(Change.NoteAddSuccess)
.onErrorReturn { Change.NoteAddError(it) }
.toObservable()
}
liminal
05/13/2018, 3:48 PM.map { Note(text = it.nodeText) }
java.lang.IllegalArgumentException: Failed requirement. and the rest of the chain does not get executed.arekolek
05/14/2018, 6:39 AMactions.ofType<Action.AddNote>()
.switchMapSingle { note ->
Single.fromCallable { Note(text = note.nodeText) }
.flatMapCompletable { addNoteUseCase.add(it) }
.subscribeOn(<http://Schedulers.io|Schedulers.io>())
.toSingleDefault<Change>(Change.NoteAddSuccess)
.onErrorReturn { Change.NoteAddError(it) }
}
ubu
05/14/2018, 12:21 PMReplaySubject
or ReplayRelay
as some kind of cash mechanism in a repository exposing it as an Observable
?rook
05/14/2018, 4:08 PMReplaySubject
stores its history indefinitely.. so just keep that in mind. Also, the only time you get every result replayed is when you attach a subscriber to it. I’m not saying not to, there’s just probably a better mechanism available (like writing your own cache).ursus
05/15/2018, 10:41 PMreplay().refCount()
should do it for caching (emitting last on subscribe)(bbade_
05/17/2018, 9:53 PMprivate val _events: ReplaySubject<Thing>
val events: Observable<Thing>
get = _events
jw
05/17/2018, 9:54 PMzak.taccardi
05/17/2018, 9:55 PMval
to expose an observable?
ex: repo.events
vs repo.events()
bbade_
05/17/2018, 9:57 PMjw
05/17/2018, 9:58 PM