-
Could you point me to, or share, an example of nested presenters? By that I mean, a "child" presenter nested within another "parent" presenter, in which the parent state is partially derived from the child state. |
Beta Was this translation helpful? Give feedback.
Answered by
ZacSweers
Dec 28, 2022
Replies: 2 comments 2 replies
-
A nested presenter would just be a presenter that is presented directly by another presenter class MyPresenter : Presenter<State> {
private val nestedPresenter = NestedPresenter()
@Composable
override fun present(): State {
val nestedState = nestedPresenter.present()
// Do whatever you need with nestedState, such as tunneling it in your parent State or reading information out of it
return State(...)
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ZacSweers
-
Appreciate you getting back to me. Could show how a nested presenter might invoke methods on the parent state or vis versa? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A nested presenter would just be a presenter that is presented directly by another presenter