malliaridis commented on PR #3656: URL: https://github.com/apache/solr/pull/3656#issuecomment-3308250746
> That said, when I was working on a dialog with four or five remember states, moving all of them into the component felt cumbersome. And this is where things get a bit blurry, because user inputs typically belong to the business states and therefore should be stored in component and store (see below). > if a state isn’t really used on the component side, we can safely keep it within the composable instead. I think that is a good rule of thumb, and to be more specific: Keep ephemeral state in the composables, that is, any state that does not have to be persisted or is used in the businesss logic. If the state value affects the components that are being loaded, then it is not ephemeral and should be part of the business state. Some examples: - A menu expanded state is ephemeral, as our business logic does not need to know if a menu is expanded or collapsed. It may fire a user intent, but that has nothing to do with the menu expanded state. - An input field is not ephemeral, because we typically want to run input validation and send a request to the backend, which both cases are part of the business logic. - A selected tab is not ephemeral, because it is used for deciding what components to load (components are business logic). > [...] where expanding should trigger a fetch to keep the data updated Even for this case we would probably use an intent like `FetchConfigsets`, instead of `ExpandMenu`. More confusing would be the dialog "opened" state, which seems at first sight very similar to the menu expanded. However, if the dialog uses a dialog component that holds data or sends some requests to the backend (like for creating a configset), the "opened" state is not ephemeral because it affects the components loaded, so it is part of the business logic. With that said I think it is clear to me how to distinguish the ephemeral state values. I hope for you too. I will continue with adding some tests to the new `TabNavigationComponent` and then merge the changes. :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
