Created
August 17, 2018 05:11
-
-
Save mcmatan/077489a342aead1a306bb1b2d7dc48f4 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
class DataBase @Inject constructor() { | |
private val realmLock = RealmLock() | |
//Home feed items | |
private fun getFeedItem(id: String): HomeFeedItem? { | |
return realmActions.getRealm() | |
.where<HomeFeedItem>().equalTo("_id", id).findFirst() | |
} | |
override fun deleteHomeFeedItem(id: String) { | |
realmActions.transaction { | |
val homeFeedItem = getFeedItem(id) | |
homeFeedItem?.deleteFromRealm() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment