Created
November 14, 2018 21:44
-
-
Save pzmudzinski/b414df945861783b52e662f27d01356f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
items = collectionActions.scan([], accumulator: { (currentBooks, action) -> [Book] in | |
switch action { | |
case .bookMarkedForDeletion(let book): | |
return currentBooks.filter { $0 != book } | |
case .collectionRefreshed(withBooks: let books): | |
return books | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment