Skip to content

Instantly share code, notes, and snippets.

@pzmudzinski
Created November 14, 2018 21:40
Show Gist options
  • Save pzmudzinski/a7e7b0479f9c90c9fd7498b2872d2ce1 to your computer and use it in GitHub Desktop.
Save pzmudzinski/a7e7b0479f9c90c9fd7498b2872d2ce1 to your computer and use it in GitHub Desktop.
class DummyApi: Api {
var userBooks = "Book 1", "Book 2", "Book 3"
func getBooks() -> Observable<[Book]> {
return userBooks
}
func deleteBook(_ book: Book) -> Single<Book> {
...wait 0.5s...
userBooks.remove(book)
...userBooks emits onNext...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment