mirror of
				https://github.com/InsanusMokrassar/MicroUtils.git
				synced 2025-11-04 06:00:22 +00:00 
			
		
		
		
	Revert "less annotations to god of lessannotations"
This reverts commit 87230d010c.
			
			
This commit is contained in:
		@@ -4,8 +4,8 @@ import dev.inmo.micro_utils.coroutines.BroadcastFlow
 | 
			
		||||
import dev.inmo.micro_utils.pagination.*
 | 
			
		||||
import kotlinx.coroutines.flow.Flow
 | 
			
		||||
import kotlin.js.JsExport
 | 
			
		||||
import kotlin.js.JsName
 | 
			
		||||
 | 
			
		||||
@JsExport
 | 
			
		||||
class ReadMapCRUDRepo<ObjectType, IdType>(
 | 
			
		||||
    private val map: Map<IdType, ObjectType> = emptyMap()
 | 
			
		||||
) : ReadStandardCRUDRepo<ObjectType, IdType> {
 | 
			
		||||
@@ -25,6 +25,7 @@ class ReadMapCRUDRepo<ObjectType, IdType>(
 | 
			
		||||
    override suspend fun count(): Long = map.size.toLong()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@JsExport
 | 
			
		||||
abstract class WriteMapCRUDRepo<ObjectType, IdType, InputValueType>(
 | 
			
		||||
    private val map: MutableMap<IdType, ObjectType> = mutableMapOf()
 | 
			
		||||
) : WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> {
 | 
			
		||||
@@ -80,7 +81,6 @@ abstract class MapCRUDRepo<ObjectType, IdType, InputValueType>(
 | 
			
		||||
    WriteMapCRUDRepo<ObjectType, IdType, InputValueType>(map)
 | 
			
		||||
 | 
			
		||||
@JsExport
 | 
			
		||||
@JsName("MapCRUDRepoFactory")
 | 
			
		||||
fun <ObjectType, IdType, InputValueType> MapCRUDRepo(
 | 
			
		||||
    map: MutableMap<IdType, ObjectType>,
 | 
			
		||||
    updateCallback: suspend (newValue: InputValueType, id: IdType, old: ObjectType) -> ObjectType,
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@ import dev.inmo.micro_utils.pagination.*
 | 
			
		||||
import kotlinx.coroutines.flow.Flow
 | 
			
		||||
import kotlin.js.JsExport
 | 
			
		||||
 | 
			
		||||
@JsExport
 | 
			
		||||
class ReadMapKeyValueRepo<Key, Value>(
 | 
			
		||||
    private val map: Map<Key, Value> = emptyMap()
 | 
			
		||||
) : ReadStandardKeyValueRepo<Key, Value> {
 | 
			
		||||
@@ -46,6 +47,7 @@ class ReadMapKeyValueRepo<Key, Value>(
 | 
			
		||||
    override suspend fun count(): Long = map.size.toLong()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@JsExport
 | 
			
		||||
class WriteMapKeyValueRepo<Key, Value>(
 | 
			
		||||
    private val map: MutableMap<Key, Value> = mutableMapOf()
 | 
			
		||||
) : WriteStandardKeyValueRepo<Key, Value> {
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@ import dev.inmo.micro_utils.pagination.utils.paginate
 | 
			
		||||
import kotlinx.coroutines.flow.Flow
 | 
			
		||||
import kotlin.js.JsExport
 | 
			
		||||
 | 
			
		||||
@JsExport
 | 
			
		||||
class MapReadOneToManyKeyValueRepo<Key, Value>(
 | 
			
		||||
    private val map: Map<Key, List<Value>> = emptyMap()
 | 
			
		||||
) : ReadOneToManyKeyValueRepo<Key, Value> {
 | 
			
		||||
@@ -45,6 +46,7 @@ class MapReadOneToManyKeyValueRepo<Key, Value>(
 | 
			
		||||
    override suspend fun count(): Long = map.size.toLong()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@JsExport
 | 
			
		||||
class MapWriteOneToManyKeyValueRepo<Key, Value>(
 | 
			
		||||
    private val map: MutableMap<Key, MutableList<Value>> = mutableMapOf()
 | 
			
		||||
) : WriteOneToManyKeyValueRepo<Key, Value> {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user