API modules do not need to setup dependency injection.
Move the implementation to the impl modules.
This commit is contained in:
parent
9eb66afd87
commit
b3ec256dfa
43 changed files with 620 additions and 405 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import extension.setupDependencyInjection
|
||||
|
||||
/*
|
||||
* Copyright (c) 2025 Element Creations Ltd.
|
||||
* Copyright 2025 New Vector Ltd.
|
||||
|
|
@ -16,8 +14,6 @@ android {
|
|||
namespace = "io.element.android.libraries.recentemojis.api"
|
||||
}
|
||||
|
||||
setupDependencyInjection()
|
||||
|
||||
dependencies {
|
||||
implementation(projects.libraries.architecture)
|
||||
implementation(projects.libraries.matrix.api)
|
||||
|
|
|
|||
|
|
@ -8,17 +8,6 @@
|
|||
|
||||
package io.element.android.libraries.recentemojis.api
|
||||
|
||||
import dev.zacsweers.metro.Inject
|
||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.libraries.matrix.api.MatrixClient
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@Inject
|
||||
class AddRecentEmoji(
|
||||
private val client: MatrixClient,
|
||||
private val dispatchers: CoroutineDispatchers,
|
||||
) {
|
||||
suspend operator fun invoke(emoji: String): Result<Unit> = withContext(dispatchers.io) {
|
||||
client.addRecentEmoji(emoji)
|
||||
}
|
||||
fun interface AddRecentEmoji {
|
||||
suspend operator fun invoke(emoji: String): Result<Unit>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue