Package-level declarations

Functions

Link copied to clipboard
fun MMKV.addEventListener(listener: (String) -> Unit): () -> Unit

Adds a listener to receive callbacks when any key in this MMKV instance changes.

Link copied to clipboard
fun MMKV.Companion.defaultMMKV(mode: MMKVMode = MMKVMode.SINGLE_PROCESS, cryptKey: String? = null): MMKV

Returns a singleton MMKV instance backed by an internal center with event dispatching capability.

Link copied to clipboard
inline fun <T : Any> MMKV.flow(key: String, default: T? = null): Flow<T?>
fun <T : Any> MMKV.flow(key: String, clazz: KClass<T>, default: T? = null): Flow<T?>

Creates a cold Flow that emits the current value for key and subsequently emits on every change to that key in this MMKV instance.

Link copied to clipboard
inline fun <T : Any> MMKV.get(key: String): T?
inline fun <T : Any> MMKV.get(key: String, default: T): T

Type-safe inline convenience for get using reified type T.

fun <T : Any> MMKV.get(key: String, clazz: KClass<T>, default: T? = null): T?

Reads a value from MMKV and decodes it as the given Kotlin class clazz.

Link copied to clipboard
fun MMKV.Companion.mmkvWithID(mmapID: String, mode: MMKVMode = MMKVMode.SINGLE_PROCESS, cryptKey: String? = null): MMKV

Returns (or creates) a named MMKV instance identified by mmapID, wrapped with event dispatching.

Link copied to clipboard
fun <T : Parcelable> MMKV.set(key: String, value: T, expire: Int = 0)

================================================ Author: 886kagg Created on: 2025/9/26 20:51 ================================================

fun <T : NSCodingProtocol> <Error class: unknown class>.set(key: String, value: T, expire: Int = 0): <Error class: unknown class>

================================================ Author: 886kagg Created on: 2025/9/26 20:51 ================================================