vint
11/08/2016, 4:21 AMval networkRequest = API.fetch() // Returns observable of data
Observable
.defer {
networkRequest
}
.takeWhile {
!allDataFetched
}
.repeat()
.subscribe {
// Do cool things, e.g. store to database and update `allDataFetched` flag
}