Created
July 16, 2021 11:27
-
-
Save cmelchior/8ce660e2b492351ab1725dd93eccbef1 to your computer and use it in GitHub Desktop.
Realm Kotlin 0.40 Release Blog Post - Version Pinning
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
// BAD: Store a global managed object | |
MyApp.GLOBAL_OBJECT = realm.objects(Person::class).first() | |
// BETTER: Copy data out into an unmanaged object | |
val person = realm.objects(Person::class).first() | |
MyApp.GLOBAL_OBJECT = Person(person.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment