<@UAA7Q4ZCH> it's an event emitter for "refresh" a...
# tornadofx
g
@bjonnh it's an event emitter for "refresh" actions, looks like it's fired to reload the SalesPerson list every time a save happens and the backing data changes (https://github.com/thomasnield/rxkotlinfx-tornadofx-demo/blob/master/src/main/kotlin/view/SalesPeopleView.kt#L114). Every time it's called it gets a list of all the SalesPerson and invokes the
subscribe
callback with that list, updating the tables items. The
doOnNext
call gets ran when the refresh action is invoked again, but before
subscribe
, and disposes of any resources it created earlier. The
flatMapSingle
maps the list into an
Observable<List<T>>
that gets fired once, instead of an
Observable<T>
that get fired with all the lists items I think. The callback in
subscribe
gets ran every time that all of that completes.