Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Recuperamos el estado actual de la sesión
self.isFavorite = DataManager.shared.existsFavoriteSesssion(named: session.title)
// 1
// 2
.receive(on: RunLoop.main)
// 3
.sink(receiveValue: { (favorited: Bool) -> Void in
if favorited
DataManager.shared.insertFavoriteSession(named: session.title, backdrop: session.imageURL)
DataManager.shared.deleteFavoriteSession(named: session.title)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.