Created
April 17, 2019 08:15
-
-
Save krzdabrowski/7fabb38b5bdb11ea4760c91ae97a8cb4 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
object ObjectBox { | |
lateinit var boxStore: BoxStore | |
private set | |
fun init(context: Context): BoxStore { | |
if (::boxStore.isInitialized && !boxStore.isClosed) { | |
return boxStore | |
} | |
boxStore = MyObjectBox.builder().androidContext(context.applicationContext).build() | |
return boxStore | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment