Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Publishers.CombineLatest( $indexEndpoint, validString)
  2. .flatMap { (indexEndpoint, search)
  3. -> AnyPublisher<[Article], Never> in
  4. self.articles = [Article]()
  5. return NewsAPI.shared.fetchArticles(from:
  6. Endpoint( index: indexEndpoint, text: search )!)
  7. }
  8. .assign(to: \.articles, on: self)
  9. .store(in: &self.cancellableSet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement