Skip to content

Conversation

mck182
Copy link

@mck182 mck182 commented Mar 18, 2025

I'd like to propose decoupling the Screen from State in the
intro docs section to suggest a better pattern.

The Screen is kind of an API that should be exposed, allowing
other code to navigate to it, but the State is internal to the
Presenter and the Ui, so this updates the docs to not nest
the State under the Screen as they are independent.

The Screen is kind of an API, allowing other code to
navigate to it, but the State is internal to the Presenter
and the Ui, so this updates the docs to not nest the
State under the Screen as they are independent.
Copy link

Thanks for the contribution! Before we can merge this, we need @mck182 to sign the Salesforce Inc. Contributor License Agreement.

data object CounterScreen : Screen {
data object CounterScreen : Screen

data object CounterCircuit {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really need the namespace object either. Maybe we remove CounterCircuit and flatten this more to CounterScreen, CounterState, and CounterEvent?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually make state an nested class of the presenter, so it clearly declares relation between presenter and state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants