Skip to content

Instantly share code, notes, and snippets.

@Arrlindii
Created June 24, 2019 18:45
Show Gist options
  • Select an option

  • Save Arrlindii/9a102d1d5fb0db834f529d636f5da019 to your computer and use it in GitHub Desktop.

Select an option

Save Arrlindii/9a102d1d5fb0db834f529d636f5da019 to your computer and use it in GitHub Desktop.
networkService.request(.login(username: username, password: password))
.flatMap { token in
networkService.request(.playlists(token))
}.flatMap { playlists in
let playlist = playlists.first
networkService.request(.songs(for: playlist.id))
}.sink(receiveCompletion: { _ in
UIApplication.shared.isNetworkActivityIndicatorVisible = false
}, receiveValue: { songs in
self.configure(with: songs)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment