Closed Nek-12 closed 6 months ago
UseCastState
could continue to exist as an internal abstract remembered state, and the parameter visible
could be extracted from it. This would replace useCaseState
with visible
for dialogs, views, etc. However, I don't see this change being worth the effort and time.
I understand the decision. We are not against creating declarative wrappers for our dialogs, however the parameter visible
in the dialog is remembered and not used as a key, which means it will not react to property change, forcing us to use the LaunchedEffect of sorts to manage it. Would it be possible to add the visible parameter as a key to the useCaseState then to make it react to changes ?
Right now the api is imperative - the dialog forces the user to create and remember a
useCaseState
, which complicates management of the dialog visibility, forcing us to use one-time events. A declarative api (like a "visible") parameter of a dialog would fit Compose better, allow greater flexibility, prevent state management issues, and simplify the usage of the library.