Remove PresenterConnector and molecule runtime in feature modules, directly call Presenter.present method
This commit is contained in:
parent
4b010e01df
commit
fc07ff29f5
11 changed files with 18 additions and 95 deletions
|
|
@ -17,8 +17,6 @@
|
|||
package io.element.android.features.roomlist
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.core.node.Node
|
||||
|
|
@ -27,7 +25,6 @@ import com.bumble.appyx.core.plugin.plugins
|
|||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedInject
|
||||
import io.element.android.anvilannotations.ContributesNode
|
||||
import io.element.android.libraries.architecture.presenterConnector
|
||||
import io.element.android.libraries.di.SessionScope
|
||||
import io.element.android.libraries.matrix.core.RoomId
|
||||
|
||||
|
|
@ -35,7 +32,7 @@ import io.element.android.libraries.matrix.core.RoomId
|
|||
class RoomListNode @AssistedInject constructor(
|
||||
@Assisted buildContext: BuildContext,
|
||||
@Assisted plugins: List<Plugin>,
|
||||
presenter: RoomListPresenter,
|
||||
private val presenter: RoomListPresenter,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
|
||||
interface Callback : Plugin {
|
||||
|
|
@ -43,8 +40,6 @@ class RoomListNode @AssistedInject constructor(
|
|||
fun onSettingsClicked()
|
||||
}
|
||||
|
||||
private val connector = presenterConnector(presenter)
|
||||
|
||||
private fun onRoomClicked(roomId: RoomId) {
|
||||
plugins<Callback>().forEach { it.onRoomClicked(roomId) }
|
||||
}
|
||||
|
|
@ -55,7 +50,7 @@ class RoomListNode @AssistedInject constructor(
|
|||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val state by connector.stateFlow.collectAsState()
|
||||
val state = presenter.present()
|
||||
RoomListView(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue