package com.kaixed.kchat.data.objectbox

import android.content.Context
import com.kaixed.kchat.data.objectbox.entity.MyObjectBox
import io.objectbox.BoxStore

/**
 * @Author: kaixed
 * @Date: 2024/10/24 16:57
 */
object ObjectBox {
    private var store: BoxStore? = null

    fun init(context: Context) {
        store = MyObjectBox.builder()
            .androidContext(context)
            .build()
    }

    fun get(): BoxStore = checkNotNull(store) { "ObjectBox is not initialized." }
}
