Skip to content

Instantly share code, notes, and snippets.

@pzmudzinski
Created November 14, 2018 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pzmudzinski/655f31892e0f14910c83425cbde63555 to your computer and use it in GitHub Desktop.
Save pzmudzinski/655f31892e0f14910c83425cbde63555 to your computer and use it in GitHub Desktop.
api.getBooks()
.map { books -> BookCollectionAction in return .collectionRefreshed(withBooks: books) }
.bind(to: collectionActions)
// ...
let bookMarkedForDeletion = deleteCommand
.withLatestFrom(items) { index, items in return items[index.row] }
// ...
bookMarkedForDeletion
.map { book -> BookCollectionAction in return .bookMarkedForDeletion(book) }
.bind(to: collectionActions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment