Hi everyone. I've been building a small Kotlin Mul...
# feed
k
Hi everyone. I've been building a small Kotlin Multiplatform library called Documents and I'd love a gut-check from this community before I put more time into it. The idea: MMKV is really fast, but it only gives you raw keys and primitives — so storing a typed object means writing your own serialization and key management every time. Documents tries to give you a typed, reactive document API on top of MMKV, shared across Android + iOS from commonMain. You define a data class and use it:
Copy code
@Serializable
 data class GameSave(val level: Int = 1, val coins: Int = 0)

 val save = Documents.document<GameSave>("slot-1")
  
 save.set(GameSave(level = 5, coins = 120))  // write the whole document
 save.set { copy(coins = coins + 50) }    // copy-style partial update
 save.flow().collect { hud.render(it) }    // reactive — the UI follows the store
Each document is stored as one key per field, so updating one field writes just that key. It's not published yet — I'm honestly asking whether it's worth publishing. If the concept doesn't land, or there's already a good answer to this that I've missed, I'd rather know now than keep polishing. If people find it useful, I'll take it the rest of the way. Repo (early, unpublished): https://github.com/nomemmurrakh/documents
j
Definitely worth publishing. KMP really lacks a persistence library that actually feels like idiomatic Kotlin. If it’s as fast and simple as it looks, people will definitely use it. Go for it!
❤️ 1