mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +00:00
less annotations to god of lessannotations
This commit is contained in:
parent
f8a8808508
commit
87230d010c
@ -9,7 +9,6 @@ import kotlin.js.JsExport
|
|||||||
|
|
||||||
typealias ByteArrayAllocator = () -> ByteArray
|
typealias ByteArrayAllocator = () -> ByteArray
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val ByteArray.asAllocator: ByteArrayAllocator
|
val ByteArray.asAllocator: ByteArrayAllocator
|
||||||
get() = { this }
|
get() = { this }
|
||||||
|
|
||||||
|
@ -3,8 +3,10 @@ package dev.inmo.micro_utils.coroutines
|
|||||||
import kotlinx.coroutines.channels.*
|
import kotlinx.coroutines.channels.*
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("BroadcastFlowFactory")
|
||||||
@Suppress("FunctionName")
|
@Suppress("FunctionName")
|
||||||
fun <T> BroadcastFlow(
|
fun <T> BroadcastFlow(
|
||||||
internalChannelSize: Int = Channel.BUFFERED
|
internalChannelSize: Int = Channel.BUFFERED
|
||||||
|
@ -5,6 +5,7 @@ import kotlinx.coroutines.channels.BroadcastChannel
|
|||||||
import kotlinx.coroutines.channels.Channel
|
import kotlinx.coroutines.channels.Channel
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
class BroadcastStateFlow<T> internal constructor(
|
class BroadcastStateFlow<T> internal constructor(
|
||||||
@ -25,6 +26,7 @@ fun <T> BroadcastChannel<T>.asStateFlow(value: T, scope: CoroutineScope): StateF
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("nullableAsStateFlow")
|
||||||
fun <T> BroadcastChannel<T?>.asStateFlow(scope: CoroutineScope): StateFlow<T?> = asStateFlow(null, scope)
|
fun <T> BroadcastChannel<T?>.asStateFlow(scope: CoroutineScope): StateFlow<T?> = asStateFlow(null, scope)
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
@ -35,5 +37,6 @@ fun <T> broadcastStateFlow(initial: T, scope: CoroutineScope, channelSize: Int =
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("nullableBroadcastStateFlow")
|
||||||
fun <T> broadcastStateFlow(scope: CoroutineScope, channelSize: Int = Channel.BUFFERED) = broadcastStateFlow<T?>(null, scope, channelSize)
|
fun <T> broadcastStateFlow(scope: CoroutineScope, channelSize: Int = Channel.BUFFERED) = broadcastStateFlow<T?>(null, scope, channelSize)
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@ package dev.inmo.micro_utils.coroutines
|
|||||||
|
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
import kotlinx.coroutines.Deferred
|
import kotlinx.coroutines.Deferred
|
||||||
import kotlin.js.JsExport
|
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val <T> T.asDeferred: Deferred<T>
|
val <T> T.asDeferred: Deferred<T>
|
||||||
get() = CompletableDeferred(this)
|
get() = CompletableDeferred(this)
|
||||||
|
@ -6,7 +6,6 @@ import kotlin.js.JsExport
|
|||||||
/**
|
/**
|
||||||
* Call this method in case you need to do something in common thread (like reading of file in JVM)
|
* Call this method in case you need to do something in common thread (like reading of file in JVM)
|
||||||
*/
|
*/
|
||||||
@JsExport
|
|
||||||
suspend fun <T> doOutsideOfCoroutine(block: () -> T): T = suspendCoroutine {
|
suspend fun <T> doOutsideOfCoroutine(block: () -> T): T = suspendCoroutine {
|
||||||
try {
|
try {
|
||||||
it.resume(block())
|
it.resume(block())
|
||||||
|
@ -12,7 +12,6 @@ typealias ExceptionHandler<T> = suspend (Throwable) -> T
|
|||||||
* @param [onException] Will be called when happen exception inside of [block]. By default will throw exception - this
|
* @param [onException] Will be called when happen exception inside of [block]. By default will throw exception - this
|
||||||
* exception will be available for catching
|
* exception will be available for catching
|
||||||
*/
|
*/
|
||||||
@JsExport
|
|
||||||
suspend inline fun <T> safely(
|
suspend inline fun <T> safely(
|
||||||
noinline onException: ExceptionHandler<T> = { throw it },
|
noinline onException: ExceptionHandler<T> = { throw it },
|
||||||
noinline block: suspend CoroutineScope.() -> T
|
noinline block: suspend CoroutineScope.() -> T
|
||||||
|
@ -9,6 +9,7 @@ import kotlinx.coroutines.flow.Flow
|
|||||||
import kotlinx.coroutines.flow.channelFlow
|
import kotlinx.coroutines.flow.channelFlow
|
||||||
import kotlinx.serialization.DeserializationStrategy
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param checkReconnection This lambda will be called when it is required to reconnect to websocket to establish
|
* @param checkReconnection This lambda will be called when it is required to reconnect to websocket to establish
|
||||||
@ -63,6 +64,7 @@ inline fun <T> HttpClient.createStandardWebsocketFlow(
|
|||||||
* connection. Must return true in case if must be reconnected. By default always reconnecting
|
* connection. Must return true in case if must be reconnected. By default always reconnecting
|
||||||
*/
|
*/
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("createStandardWebsocketFlowWithDeserializer")
|
||||||
inline fun <T> HttpClient.createStandardWebsocketFlow(
|
inline fun <T> HttpClient.createStandardWebsocketFlow(
|
||||||
url: String,
|
url: String,
|
||||||
crossinline checkReconnection: (Throwable?) -> Boolean = { true },
|
crossinline checkReconnection: (Throwable?) -> Boolean = { true },
|
||||||
|
@ -9,7 +9,6 @@ import kotlin.js.JsExport
|
|||||||
|
|
||||||
typealias BodyPair<T> = Pair<SerializationStrategy<T>, T>
|
typealias BodyPair<T> = Pair<SerializationStrategy<T>, T>
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend fun <ResultType> HttpClient.uniget(
|
suspend fun <ResultType> HttpClient.uniget(
|
||||||
url: String,
|
url: String,
|
||||||
resultDeserializer: DeserializationStrategy<ResultType>
|
resultDeserializer: DeserializationStrategy<ResultType>
|
||||||
@ -26,7 +25,6 @@ fun <T> SerializationStrategy<T>.encodeUrlQueryValue(value: T) = standardKtorSer
|
|||||||
value
|
value
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend fun <BodyType, ResultType> HttpClient.unipost(
|
suspend fun <BodyType, ResultType> HttpClient.unipost(
|
||||||
url: String,
|
url: String,
|
||||||
bodyInfo: BodyPair<BodyType>,
|
bodyInfo: BodyPair<BodyType>,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.micro_utils.ktor.common
|
package dev.inmo.micro_utils.ktor.common
|
||||||
|
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
fun buildStandardUrl(
|
fun buildStandardUrl(
|
||||||
@ -12,6 +13,7 @@ fun buildStandardUrl(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("buildStandardUrlWithParametersList")
|
||||||
fun buildStandardUrl(
|
fun buildStandardUrl(
|
||||||
basePart: String,
|
basePart: String,
|
||||||
subpart: String,
|
subpart: String,
|
||||||
@ -21,6 +23,7 @@ fun buildStandardUrl(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("buildStandardUrlWithParametersVararg")
|
||||||
fun buildStandardUrl(
|
fun buildStandardUrl(
|
||||||
basePart: String,
|
basePart: String,
|
||||||
subpart: String,
|
subpart: String,
|
||||||
|
@ -4,7 +4,6 @@ import kotlin.js.JsExport
|
|||||||
|
|
||||||
private val schemaRegex = Regex("^[^:]*://")
|
private val schemaRegex = Regex("^[^:]*://")
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val String.asCorrectWebSocketUrl: String
|
val String.asCorrectWebSocketUrl: String
|
||||||
get() = if (startsWith("ws")) {
|
get() = if (startsWith("ws")) {
|
||||||
this
|
this
|
||||||
|
@ -5,14 +5,12 @@ import kotlin.js.JsExport
|
|||||||
|
|
||||||
typealias FromToDateTime = Pair<DateTime?, DateTime?>
|
typealias FromToDateTime = Pair<DateTime?, DateTime?>
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val FromToDateTime.asFromToUrlPart: QueryParams
|
val FromToDateTime.asFromToUrlPart: QueryParams
|
||||||
get() = mapOf(
|
get() = mapOf(
|
||||||
"from" to first ?.unixMillis ?.toString(),
|
"from" to first ?.unixMillis ?.toString(),
|
||||||
"to" to second ?.unixMillis ?.toString()
|
"to" to second ?.unixMillis ?.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val QueryParams.extractFromToDateTime: FromToDateTime
|
val QueryParams.extractFromToDateTime: FromToDateTime
|
||||||
get() = FromToDateTime(
|
get() = FromToDateTime(
|
||||||
get("from") ?.toDoubleOrNull() ?.let { DateTime(it) },
|
get("from") ?.toDoubleOrNull() ?.let { DateTime(it) },
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
package dev.inmo.micro_utils.ktor.common
|
package dev.inmo.micro_utils.ktor.common
|
||||||
|
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
typealias QueryParam = Pair<String, String?>
|
typealias QueryParam = Pair<String, String?>
|
||||||
typealias QueryParams = Map<String, String?>
|
typealias QueryParams = Map<String, String?>
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val QueryParams.asUrlQuery: String
|
val QueryParams.asUrlQuery: String
|
||||||
get() = keys.joinToString("&") { "${it}${get(it) ?.let { value -> "=$value" }}" }
|
get() = keys.joinToString("&") { "${it}${get(it) ?.let { value -> "=$value" }}" }
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val List<QueryParam>.asUrlQuery: String
|
val List<QueryParam>.asUrlQuery: String
|
||||||
get() = joinToString("&") { (key, value) -> "${key}${value ?.let { _ -> "=$value" }}" }
|
get() = joinToString("&") { (key, value) -> "${key}${value ?.let { _ -> "=$value" }}" }
|
||||||
|
|
||||||
@ -19,11 +18,11 @@ fun String.includeQueryParams(
|
|||||||
): String = "$this${if(queryParams.isNotEmpty()) "${if (contains("?")) "&" else "?"}${queryParams.asUrlQuery}" else ""}"
|
): String = "$this${if(queryParams.isNotEmpty()) "${if (contains("?")) "&" else "?"}${queryParams.asUrlQuery}" else ""}"
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("includeQueryParamsWithList")
|
||||||
fun String.includeQueryParams(
|
fun String.includeQueryParams(
|
||||||
queryParams: List<QueryParam>
|
queryParams: List<QueryParam>
|
||||||
): String = "$this${if (contains("?")) "&" else "?"}${queryParams.asUrlQuery}"
|
): String = "$this${if (contains("?")) "&" else "?"}${queryParams.asUrlQuery}"
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val String.parseUrlQuery: QueryParams
|
val String.parseUrlQuery: QueryParams
|
||||||
get() = split("&").map {
|
get() = split("&").map {
|
||||||
it.split("=").let { pair ->
|
it.split("=").let { pair ->
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.micro_utils.pagination
|
package dev.inmo.micro_utils.pagination
|
||||||
|
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
import kotlin.math.floor
|
import kotlin.math.floor
|
||||||
|
|
||||||
@ -27,7 +28,6 @@ interface Pagination {
|
|||||||
/**
|
/**
|
||||||
* First number in index of objects. It can be used as offset for databases or other data sources
|
* First number in index of objects. It can be used as offset for databases or other data sources
|
||||||
*/
|
*/
|
||||||
@JsExport
|
|
||||||
val Pagination.firstIndex: Int
|
val Pagination.firstIndex: Int
|
||||||
get() = page * size
|
get() = page * size
|
||||||
|
|
||||||
@ -37,7 +37,6 @@ val Pagination.firstIndex: Int
|
|||||||
* [[firstIndex], [lastIndex]]; That means, that for [Pagination] with [Pagination.size] == 10 and [Pagination.page] == 1
|
* [[firstIndex], [lastIndex]]; That means, that for [Pagination] with [Pagination.size] == 10 and [Pagination.page] == 1
|
||||||
* you will retrieve [Pagination.firstIndex] == 10 and [Pagination.lastIndex] == 19.
|
* you will retrieve [Pagination.firstIndex] == 10 and [Pagination.lastIndex] == 19.
|
||||||
*/
|
*/
|
||||||
@JsExport
|
|
||||||
val Pagination.lastIndex: Int
|
val Pagination.lastIndex: Int
|
||||||
get() = firstIndex + size - 1
|
get() = firstIndex + size - 1
|
||||||
|
|
||||||
@ -52,6 +51,7 @@ fun calculatePagesNumber(datasetSize: Long, pageSize: Int): Int {
|
|||||||
* Calculates pages count for given [datasetSize]
|
* Calculates pages count for given [datasetSize]
|
||||||
*/
|
*/
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("calculatePagesNumberWithInt")
|
||||||
fun calculatePagesNumber(datasetSize: Int, pageSize: Int): Int =
|
fun calculatePagesNumber(datasetSize: Int, pageSize: Int): Int =
|
||||||
calculatePagesNumber(
|
calculatePagesNumber(
|
||||||
datasetSize.toLong(),
|
datasetSize.toLong(),
|
||||||
|
@ -2,6 +2,7 @@ package dev.inmo.micro_utils.pagination
|
|||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
@Serializable
|
@Serializable
|
||||||
@ -16,6 +17,7 @@ data class PaginationResult<T>(
|
|||||||
fun <T> emptyPaginationResult() = PaginationResult<T>(0, 0, emptyList(), 0)
|
fun <T> emptyPaginationResult() = PaginationResult<T>(0, 0, emptyList(), 0)
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("createPaginationResultWithPagination")
|
||||||
fun <T> List<T>.createPaginationResult(
|
fun <T> List<T>.createPaginationResult(
|
||||||
pagination: Pagination,
|
pagination: Pagination,
|
||||||
commonObjectsNumber: Long
|
commonObjectsNumber: Long
|
||||||
@ -30,6 +32,7 @@ fun <T> List<T>.createPaginationResult(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("createPaginationResultWithFirstIndex")
|
||||||
fun <T> List<T>.createPaginationResult(
|
fun <T> List<T>.createPaginationResult(
|
||||||
firstIndex: Int,
|
firstIndex: Int,
|
||||||
commonObjectsNumber: Long
|
commonObjectsNumber: Long
|
||||||
@ -44,6 +47,7 @@ fun <T> List<T>.createPaginationResult(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("createPaginationResultWithPair")
|
||||||
fun <T> Pair<Long, List<T>>.createPaginationResult(
|
fun <T> Pair<Long, List<T>>.createPaginationResult(
|
||||||
pagination: Pagination
|
pagination: Pagination
|
||||||
) = second.createPaginationResult(pagination, first)
|
) = second.createPaginationResult(pagination, first)
|
||||||
|
@ -2,6 +2,7 @@ package dev.inmo.micro_utils.pagination
|
|||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
const val defaultSmallPageSize = 2
|
const val defaultSmallPageSize = 2
|
||||||
const val defaultMediumPageSize = 5
|
const val defaultMediumPageSize = 5
|
||||||
@ -32,6 +33,7 @@ data class SimplePagination(
|
|||||||
) : Pagination
|
) : Pagination
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("PaginationFactory")
|
||||||
fun Pagination(
|
fun Pagination(
|
||||||
page: Int,
|
page: Int,
|
||||||
size: Int
|
size: Int
|
||||||
|
@ -2,6 +2,7 @@ package dev.inmo.micro_utils.pagination.utils
|
|||||||
|
|
||||||
import dev.inmo.micro_utils.pagination.*
|
import dev.inmo.micro_utils.pagination.*
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
fun <T> Iterable<T>.paginate(with: Pagination): PaginationResult<T> {
|
fun <T> Iterable<T>.paginate(with: Pagination): PaginationResult<T> {
|
||||||
@ -23,6 +24,7 @@ fun <T> Iterable<T>.paginate(with: Pagination): PaginationResult<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("paginateList")
|
||||||
fun <T> List<T>.paginate(with: Pagination): PaginationResult<T> {
|
fun <T> List<T>.paginate(with: Pagination): PaginationResult<T> {
|
||||||
return subList(with.firstIndex, with.lastIndex + 1).createPaginationResult(
|
return subList(with.firstIndex, with.lastIndex + 1).createPaginationResult(
|
||||||
with,
|
with,
|
||||||
@ -31,6 +33,7 @@ fun <T> List<T>.paginate(with: Pagination): PaginationResult<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("paginateSet")
|
||||||
fun <T> Set<T>.paginate(with: Pagination): PaginationResult<T> {
|
fun <T> Set<T>.paginate(with: Pagination): PaginationResult<T> {
|
||||||
return this.drop(with.firstIndex).take(with.size).createPaginationResult(
|
return this.drop(with.firstIndex).take(with.size).createPaginationResult(
|
||||||
with,
|
with,
|
||||||
|
@ -7,21 +7,18 @@ const val paginationPageKey = "ppage"
|
|||||||
@JsExport
|
@JsExport
|
||||||
const val paginationSizeKey = "psize"
|
const val paginationSizeKey = "psize"
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val Pagination.asUrlQueryParts
|
val Pagination.asUrlQueryParts
|
||||||
get() = mapOf(
|
get() = mapOf(
|
||||||
paginationPageKey to page.toString(),
|
paginationPageKey to page.toString(),
|
||||||
paginationSizeKey to size.toString()
|
paginationSizeKey to size.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val Pagination.asUrlQueryArrayParts
|
val Pagination.asUrlQueryArrayParts
|
||||||
get() = arrayOf(
|
get() = arrayOf(
|
||||||
paginationPageKey to page.toString(),
|
paginationPageKey to page.toString(),
|
||||||
paginationSizeKey to size.toString()
|
paginationSizeKey to size.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsExport
|
|
||||||
val Map<String, String?>.extractPagination: Pagination
|
val Map<String, String?>.extractPagination: Pagination
|
||||||
get() = SimplePagination(
|
get() = SimplePagination(
|
||||||
get(paginationPageKey) ?.toIntOrNull() ?: 0,
|
get(paginationPageKey) ?.toIntOrNull() ?: 0,
|
||||||
|
@ -5,7 +5,6 @@ import dev.inmo.micro_utils.pagination.PaginationResult
|
|||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface ReadOneToManyKeyValueRepo<Key, Value> : Repo {
|
interface ReadOneToManyKeyValueRepo<Key, Value> : Repo {
|
||||||
suspend fun get(k: Key, pagination: Pagination, reversed: Boolean = false): PaginationResult<Value>
|
suspend fun get(k: Key, pagination: Pagination, reversed: Boolean = false): PaginationResult<Value>
|
||||||
suspend fun keys(pagination: Pagination, reversed: Boolean = false): PaginationResult<Key>
|
suspend fun keys(pagination: Pagination, reversed: Boolean = false): PaginationResult<Key>
|
||||||
@ -17,7 +16,6 @@ interface ReadOneToManyKeyValueRepo<Key, Value> : Repo {
|
|||||||
@Deprecated("Renamed", ReplaceWith("ReadOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo"))
|
@Deprecated("Renamed", ReplaceWith("ReadOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo"))
|
||||||
typealias OneToManyReadKeyValueRepo<Key, Value> = ReadOneToManyKeyValueRepo<Key, Value>
|
typealias OneToManyReadKeyValueRepo<Key, Value> = ReadOneToManyKeyValueRepo<Key, Value>
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface WriteOneToManyKeyValueRepo<Key, Value> : Repo {
|
interface WriteOneToManyKeyValueRepo<Key, Value> : Repo {
|
||||||
val onNewValue: Flow<Pair<Key, Value>>
|
val onNewValue: Flow<Pair<Key, Value>>
|
||||||
val onValueRemoved: Flow<Pair<Key, Value>>
|
val onValueRemoved: Flow<Pair<Key, Value>>
|
||||||
@ -30,5 +28,4 @@ interface WriteOneToManyKeyValueRepo<Key, Value> : Repo {
|
|||||||
@Deprecated("Renamed", ReplaceWith("WriteOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.WriteOneToManyKeyValueRepo"))
|
@Deprecated("Renamed", ReplaceWith("WriteOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.WriteOneToManyKeyValueRepo"))
|
||||||
typealias OneToManyWriteKeyValueRepo<Key, Value> = WriteOneToManyKeyValueRepo<Key, Value>
|
typealias OneToManyWriteKeyValueRepo<Key, Value> = WriteOneToManyKeyValueRepo<Key, Value>
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface OneToManyKeyValueRepo<Key, Value> : ReadOneToManyKeyValueRepo<Key, Value>, WriteOneToManyKeyValueRepo<Key, Value>
|
interface OneToManyKeyValueRepo<Key, Value> : ReadOneToManyKeyValueRepo<Key, Value>, WriteOneToManyKeyValueRepo<Key, Value>
|
@ -5,7 +5,6 @@ import dev.inmo.micro_utils.pagination.PaginationResult
|
|||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface ReadStandardCRUDRepo<ObjectType, IdType> : Repo {
|
interface ReadStandardCRUDRepo<ObjectType, IdType> : Repo {
|
||||||
suspend fun getByPagination(pagination: Pagination): PaginationResult<ObjectType>
|
suspend fun getByPagination(pagination: Pagination): PaginationResult<ObjectType>
|
||||||
suspend fun getById(id: IdType): ObjectType?
|
suspend fun getById(id: IdType): ObjectType?
|
||||||
@ -14,14 +13,11 @@ interface ReadStandardCRUDRepo<ObjectType, IdType> : Repo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
typealias UpdatedValuePair<IdType, ValueType> = Pair<IdType, ValueType>
|
typealias UpdatedValuePair<IdType, ValueType> = Pair<IdType, ValueType>
|
||||||
@JsExport
|
|
||||||
val <IdType> UpdatedValuePair<IdType, *>.id
|
val <IdType> UpdatedValuePair<IdType, *>.id
|
||||||
get() = first
|
get() = first
|
||||||
@JsExport
|
|
||||||
val <ValueType> UpdatedValuePair<*, ValueType>.value
|
val <ValueType> UpdatedValuePair<*, ValueType>.value
|
||||||
get() = second
|
get() = second
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> : Repo {
|
interface WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> : Repo {
|
||||||
val newObjectsFlow: Flow<ObjectType>
|
val newObjectsFlow: Flow<ObjectType>
|
||||||
val updatedObjectsFlow: Flow<ObjectType>
|
val updatedObjectsFlow: Flow<ObjectType>
|
||||||
@ -33,15 +29,12 @@ interface WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> : Repo {
|
|||||||
suspend fun deleteById(ids: List<IdType>)
|
suspend fun deleteById(ids: List<IdType>)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.create(
|
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.create(
|
||||||
vararg values: InputValueType
|
vararg values: InputValueType
|
||||||
): List<ObjectType> = create(values.toList())
|
): List<ObjectType> = create(values.toList())
|
||||||
@JsExport
|
|
||||||
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.update(
|
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.update(
|
||||||
vararg values: UpdatedValuePair<IdType, InputValueType>
|
vararg values: UpdatedValuePair<IdType, InputValueType>
|
||||||
): List<ObjectType> = update(values.toList())
|
): List<ObjectType> = update(values.toList())
|
||||||
@JsExport
|
|
||||||
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.deleteById(
|
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.deleteById(
|
||||||
vararg ids: IdType
|
vararg ids: IdType
|
||||||
) = deleteById(ids.toList())
|
) = deleteById(ids.toList())
|
||||||
|
@ -5,7 +5,6 @@ import dev.inmo.micro_utils.pagination.PaginationResult
|
|||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface ReadStandardKeyValueRepo<Key, Value> : Repo {
|
interface ReadStandardKeyValueRepo<Key, Value> : Repo {
|
||||||
suspend fun get(k: Key): Value?
|
suspend fun get(k: Key): Value?
|
||||||
suspend fun values(pagination: Pagination, reversed: Boolean = false): PaginationResult<Value>
|
suspend fun values(pagination: Pagination, reversed: Boolean = false): PaginationResult<Value>
|
||||||
@ -14,7 +13,6 @@ interface ReadStandardKeyValueRepo<Key, Value> : Repo {
|
|||||||
suspend fun count(): Long
|
suspend fun count(): Long
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface WriteStandardKeyValueRepo<Key, Value> : Repo {
|
interface WriteStandardKeyValueRepo<Key, Value> : Repo {
|
||||||
val onNewValue: Flow<Pair<Key, Value>>
|
val onNewValue: Flow<Pair<Key, Value>>
|
||||||
val onValueRemoved: Flow<Key>
|
val onValueRemoved: Flow<Key>
|
||||||
@ -23,5 +21,4 @@ interface WriteStandardKeyValueRepo<Key, Value> : Repo {
|
|||||||
suspend fun unset(k: Key)
|
suspend fun unset(k: Key)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
interface StandardKeyValueRepo<Key, Value> : ReadStandardKeyValueRepo<Key, Value>, WriteStandardKeyValueRepo<Key, Value>
|
interface StandardKeyValueRepo<Key, Value> : ReadStandardKeyValueRepo<Key, Value>, WriteStandardKeyValueRepo<Key, Value>
|
@ -4,7 +4,6 @@ import dev.inmo.micro_utils.pagination.*
|
|||||||
import dev.inmo.micro_utils.repos.ReadStandardCRUDRepo
|
import dev.inmo.micro_utils.repos.ReadStandardCRUDRepo
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
||||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>,
|
methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>,
|
||||||
@ -17,12 +16,10 @@ suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
||||||
block: (List<T>) -> Unit
|
block: (List<T>) -> Unit
|
||||||
) = doForAll({ getByPagination(it) }, block)
|
) = doForAll({ getByPagination(it) }, block)
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.getAll(
|
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.getAll(
|
||||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>
|
methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>
|
||||||
|
@ -4,7 +4,6 @@ import dev.inmo.micro_utils.pagination.*
|
|||||||
import dev.inmo.micro_utils.repos.*
|
import dev.inmo.micro_utils.repos.*
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
||||||
@ -17,12 +16,10 @@ suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||||
block: (List<Pair<Key, Value>>) -> Unit
|
block: (List<Pair<Key, Value>>) -> Unit
|
||||||
) = doForAll({ keys(it, false) }, block)
|
) = doForAll({ keys(it, false) }, block)
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.getAll(
|
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.getAll(
|
||||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
||||||
|
@ -4,7 +4,6 @@ import dev.inmo.micro_utils.pagination.*
|
|||||||
import dev.inmo.micro_utils.repos.*
|
import dev.inmo.micro_utils.repos.*
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
||||||
@ -27,12 +26,10 @@ suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> RE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||||
block: (List<Pair<Key, List<Value>>>) -> Unit
|
block: (List<Pair<Key, List<Value>>>) -> Unit
|
||||||
) = doForAll({ keys(it, false) }, block)
|
) = doForAll({ keys(it, false) }, block)
|
||||||
|
|
||||||
@JsExport
|
|
||||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.getAll(
|
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.getAll(
|
||||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
||||||
|
@ -4,8 +4,8 @@ import dev.inmo.micro_utils.coroutines.BroadcastFlow
|
|||||||
import dev.inmo.micro_utils.pagination.*
|
import dev.inmo.micro_utils.pagination.*
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
import kotlin.js.JsName
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class ReadMapCRUDRepo<ObjectType, IdType>(
|
class ReadMapCRUDRepo<ObjectType, IdType>(
|
||||||
private val map: Map<IdType, ObjectType> = emptyMap()
|
private val map: Map<IdType, ObjectType> = emptyMap()
|
||||||
) : ReadStandardCRUDRepo<ObjectType, IdType> {
|
) : ReadStandardCRUDRepo<ObjectType, IdType> {
|
||||||
@ -25,7 +25,6 @@ class ReadMapCRUDRepo<ObjectType, IdType>(
|
|||||||
override suspend fun count(): Long = map.size.toLong()
|
override suspend fun count(): Long = map.size.toLong()
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
abstract class WriteMapCRUDRepo<ObjectType, IdType, InputValueType>(
|
abstract class WriteMapCRUDRepo<ObjectType, IdType, InputValueType>(
|
||||||
private val map: MutableMap<IdType, ObjectType> = mutableMapOf()
|
private val map: MutableMap<IdType, ObjectType> = mutableMapOf()
|
||||||
) : WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> {
|
) : WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> {
|
||||||
@ -81,6 +80,7 @@ abstract class MapCRUDRepo<ObjectType, IdType, InputValueType>(
|
|||||||
WriteMapCRUDRepo<ObjectType, IdType, InputValueType>(map)
|
WriteMapCRUDRepo<ObjectType, IdType, InputValueType>(map)
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
|
@JsName("MapCRUDRepoFactory")
|
||||||
fun <ObjectType, IdType, InputValueType> MapCRUDRepo(
|
fun <ObjectType, IdType, InputValueType> MapCRUDRepo(
|
||||||
map: MutableMap<IdType, ObjectType>,
|
map: MutableMap<IdType, ObjectType>,
|
||||||
updateCallback: suspend (newValue: InputValueType, id: IdType, old: ObjectType) -> ObjectType,
|
updateCallback: suspend (newValue: InputValueType, id: IdType, old: ObjectType) -> ObjectType,
|
||||||
|
@ -5,7 +5,6 @@ import dev.inmo.micro_utils.pagination.*
|
|||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class ReadMapKeyValueRepo<Key, Value>(
|
class ReadMapKeyValueRepo<Key, Value>(
|
||||||
private val map: Map<Key, Value> = emptyMap()
|
private val map: Map<Key, Value> = emptyMap()
|
||||||
) : ReadStandardKeyValueRepo<Key, Value> {
|
) : ReadStandardKeyValueRepo<Key, Value> {
|
||||||
@ -47,7 +46,6 @@ class ReadMapKeyValueRepo<Key, Value>(
|
|||||||
override suspend fun count(): Long = map.size.toLong()
|
override suspend fun count(): Long = map.size.toLong()
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class WriteMapKeyValueRepo<Key, Value>(
|
class WriteMapKeyValueRepo<Key, Value>(
|
||||||
private val map: MutableMap<Key, Value> = mutableMapOf()
|
private val map: MutableMap<Key, Value> = mutableMapOf()
|
||||||
) : WriteStandardKeyValueRepo<Key, Value> {
|
) : WriteStandardKeyValueRepo<Key, Value> {
|
||||||
|
@ -6,7 +6,6 @@ import dev.inmo.micro_utils.pagination.utils.paginate
|
|||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class MapReadOneToManyKeyValueRepo<Key, Value>(
|
class MapReadOneToManyKeyValueRepo<Key, Value>(
|
||||||
private val map: Map<Key, List<Value>> = emptyMap()
|
private val map: Map<Key, List<Value>> = emptyMap()
|
||||||
) : ReadOneToManyKeyValueRepo<Key, Value> {
|
) : ReadOneToManyKeyValueRepo<Key, Value> {
|
||||||
@ -46,7 +45,6 @@ class MapReadOneToManyKeyValueRepo<Key, Value>(
|
|||||||
override suspend fun count(): Long = map.size.toLong()
|
override suspend fun count(): Long = map.size.toLong()
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class MapWriteOneToManyKeyValueRepo<Key, Value>(
|
class MapWriteOneToManyKeyValueRepo<Key, Value>(
|
||||||
private val map: MutableMap<Key, MutableList<Value>> = mutableMapOf()
|
private val map: MutableMap<Key, MutableList<Value>> = mutableMapOf()
|
||||||
) : WriteOneToManyKeyValueRepo<Key, Value> {
|
) : WriteOneToManyKeyValueRepo<Key, Value> {
|
||||||
|
@ -13,7 +13,6 @@ import kotlinx.serialization.KSerializer
|
|||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class KtorReadStandardCrudRepo<ObjectType, IdType> (
|
class KtorReadStandardCrudRepo<ObjectType, IdType> (
|
||||||
private val baseUrl: String,
|
private val baseUrl: String,
|
||||||
private val client: HttpClient = HttpClient(),
|
private val client: HttpClient = HttpClient(),
|
||||||
|
@ -13,7 +13,6 @@ import kotlinx.serialization.KSerializer
|
|||||||
import kotlinx.serialization.builtins.*
|
import kotlinx.serialization.builtins.*
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class KtorWriteStandardCrudRepo<ObjectType, IdType, InputValue> (
|
class KtorWriteStandardCrudRepo<ObjectType, IdType, InputValue> (
|
||||||
private val baseUrl: String,
|
private val baseUrl: String,
|
||||||
private val client: HttpClient = HttpClient(),
|
private val client: HttpClient = HttpClient(),
|
||||||
|
@ -13,7 +13,6 @@ import kotlinx.serialization.KSerializer
|
|||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class KtorReadStandardKeyValueRepo<Key, Value> (
|
class KtorReadStandardKeyValueRepo<Key, Value> (
|
||||||
private var baseUrl: String,
|
private var baseUrl: String,
|
||||||
private var client: HttpClient = HttpClient(),
|
private var client: HttpClient = HttpClient(),
|
||||||
|
@ -13,7 +13,6 @@ import kotlinx.serialization.builtins.PairSerializer
|
|||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class KtorWriteStandardKeyValueRepo<K, V> (
|
class KtorWriteStandardKeyValueRepo<K, V> (
|
||||||
private var baseUrl: String,
|
private var baseUrl: String,
|
||||||
private var client: HttpClient = HttpClient(),
|
private var client: HttpClient = HttpClient(),
|
||||||
|
@ -13,7 +13,6 @@ import kotlinx.serialization.KSerializer
|
|||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class KtorReadOneToManyKeyValueRepo<Key, Value> (
|
class KtorReadOneToManyKeyValueRepo<Key, Value> (
|
||||||
private val baseUrl: String,
|
private val baseUrl: String,
|
||||||
private val client: HttpClient = HttpClient(),
|
private val client: HttpClient = HttpClient(),
|
||||||
|
@ -13,7 +13,6 @@ import kotlinx.serialization.builtins.PairSerializer
|
|||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
import kotlin.js.JsExport
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
@JsExport
|
|
||||||
class KtorWriteOneToManyKeyValueRepo<Key, Value> (
|
class KtorWriteOneToManyKeyValueRepo<Key, Value> (
|
||||||
private val baseUrl: String,
|
private val baseUrl: String,
|
||||||
private val client: HttpClient = HttpClient(),
|
private val client: HttpClient = HttpClient(),
|
||||||
|
Loading…
Reference in New Issue
Block a user