diff --git a/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapCRUDRepo.kt b/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapCRUDRepo.kt index 96bbbfa18b2..a2194f0b96a 100644 --- a/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapCRUDRepo.kt +++ b/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapCRUDRepo.kt @@ -89,3 +89,8 @@ fun MapCRUDRepo( override suspend fun createObject(newValue: InputValueType): Pair = createCallback(newValue) } + +fun MutableMap.asCrudRepo( + updateCallback: suspend (newValue: InputValueType, id: IdType, old: ObjectType) -> ObjectType, + createCallback: suspend (newValue: InputValueType) -> Pair +) = MapCRUDRepo(this, updateCallback, createCallback)