Skip to content

Instantly share code, notes, and snippets.

@SwiftyAlex
Last active September 22, 2019 15:48
Show Gist options
  • Save SwiftyAlex/c469436388298a1aafab3f55acde5ca8 to your computer and use it in GitHub Desktop.
Save SwiftyAlex/c469436388298a1aafab3f55acde5ca8 to your computer and use it in GitHub Desktop.
Todo Service
import Foundation
import Combine
public class TodoService {
public func getTodo(todo: Todo) -> AnyPublisher<Todo, Error> {
return Router.performRequest(GetTodoRoute(todo: todo))
.receive(on: DispatchQueue.main)
.eraseToAnyPublisher()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment