Remove PresenterConnector and molecule runtime in feature modules, directly call Presenter.present method

This commit is contained in:
ganfra 2023-02-01 15:56:07 +01:00
parent 4b010e01df
commit fc07ff29f5
11 changed files with 18 additions and 95 deletions

View file

@ -17,8 +17,6 @@
package io.element.android.features.rageshake.bugreport
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,25 +25,22 @@ 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.AppScope
@ContributesNode(AppScope::class)
class BugReportNode @AssistedInject constructor(
@Assisted buildContext: BuildContext,
@Assisted plugins: List<Plugin>,
presenter: BugReportPresenter,
private val presenter: BugReportPresenter,
) : Node(buildContext, plugins = plugins) {
private val presenterConnector = presenterConnector(presenter)
interface Callback : Plugin {
fun onBugReportSent()
}
@Composable
override fun View(modifier: Modifier) {
val state by presenterConnector.stateFlow.collectAsState()
val state = presenter.present()
BugReportView(
state = state,
modifier = modifier,