Remove NodeBuilder to ensure that Params and Callback are always provided.
This commit is contained in:
parent
be03c50aaf
commit
02dc71c4c3
115 changed files with 954 additions and 1174 deletions
|
|
@ -6,12 +6,7 @@ import com.bumble.appyx.core.plugin.Plugin
|
|||
import io.element.android.libraries.architecture.FeatureEntryPoint
|
||||
|
||||
interface ${FEATURE_NAME}EntryPoint : FeatureEntryPoint {
|
||||
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
||||
|
||||
interface NodeBuilder {
|
||||
fun callback(callback: Callback): NodeBuilder
|
||||
fun build(): Node
|
||||
}
|
||||
fun createNode(parentNode: Node, buildContext: BuildContext, callback: Callback): Node
|
||||
|
||||
interface Callback : Plugin {
|
||||
// Add your callbacks
|
||||
|
|
|
|||
|
|
@ -11,19 +11,7 @@ import dev.zacsweers.metro.AppScope
|
|||
@ContributesBinding(AppScope::class)
|
||||
class Default${FEATURE_NAME}EntryPoint() : ${FEATURE_NAME}EntryPoint {
|
||||
|
||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): ${FEATURE_NAME}EntryPoint.NodeBuilder {
|
||||
val plugins = ArrayList<Plugin>()
|
||||
|
||||
return object : ${FEATURE_NAME}EntryPoint.NodeBuilder {
|
||||
|
||||
override fun callback(callback: ${FEATURE_NAME}EntryPoint.Callback): ${FEATURE_NAME}EntryPoint.NodeBuilder {
|
||||
plugins += callback
|
||||
return this
|
||||
}
|
||||
|
||||
override fun build(): Node {
|
||||
return parentNode.createNode<${FEATURE_NAME}FlowNode>(buildContext, plugins)
|
||||
}
|
||||
}
|
||||
override fun createNode(parentNode: Node, buildContext: BuildContext, callback: ${FEATURE_NAME}EntryPoint.Callback): Node {
|
||||
return parentNode.createNode<${FEATURE_NAME}FlowNode>(buildContext, listOf(callback))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue