[Docs] Decouple Screen class from State class in the docs example#2000
Open
mck182 wants to merge 1 commit intoslackhq:mainfrom
Open
[Docs] Decouple Screen class from State class in the docs example#2000mck182 wants to merge 1 commit intoslackhq:mainfrom
mck182 wants to merge 1 commit intoslackhq:mainfrom
Conversation
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.
|
Thanks for the contribution! Before we can merge this, we need @mck182 to sign the Salesforce Inc. Contributor License Agreement. |
stagg
reviewed
May 26, 2025
| data object CounterScreen : Screen { | ||
| data object CounterScreen : Screen | ||
|
|
||
| data object CounterCircuit { |
Collaborator
There was a problem hiding this comment.
We don't really need the namespace object either. Maybe we remove CounterCircuit and flatten this more to CounterScreen, CounterState, and CounterEvent?
Contributor
There was a problem hiding this comment.
We usually make state an nested class of the presenter, so it clearly declares relation between presenter and state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.