Use context parameter for the parentNode

This commit is contained in:
Benoit Marty 2025-10-30 13:02:20 +01:00 committed by Benoit Marty
parent 02dc71c4c3
commit f174084942
138 changed files with 450 additions and 375 deletions

View file

@ -6,7 +6,8 @@ import com.bumble.appyx.core.plugin.Plugin
import io.element.android.libraries.architecture.FeatureEntryPoint
interface ${FEATURE_NAME}EntryPoint : FeatureEntryPoint {
fun createNode(parentNode: Node, buildContext: BuildContext, callback: Callback): Node
context(parentNode: Node)
fun createNode(buildContext: BuildContext, callback: Callback): Node
interface Callback : Plugin {
// Add your callbacks

View file

@ -10,8 +10,8 @@ import dev.zacsweers.metro.AppScope
@ContributesBinding(AppScope::class)
class Default${FEATURE_NAME}EntryPoint() : ${FEATURE_NAME}EntryPoint {
override fun createNode(parentNode: Node, buildContext: BuildContext, callback: ${FEATURE_NAME}EntryPoint.Callback): Node {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, callback: ${FEATURE_NAME}EntryPoint.Callback): Node {
return parentNode.createNode<${FEATURE_NAME}FlowNode>(buildContext, listOf(callback))
}
}