Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract properties to state object #126

Open
StefMa opened this issue Aug 28, 2024 · 0 comments
Open

Extract properties to state object #126

StefMa opened this issue Aug 28, 2024 · 0 comments

Comments

@StefMa
Copy link
Collaborator

StefMa commented Aug 28, 2024

Right now we have the following properties as function params:

enabled: Boolean = true,
startDelay: Duration = Duration.ZERO,
duration: Duration = 10L.seconds,
restDuration: Duration = duration,

Maybe it make sense to extract a state object like ProgressButtonState that contains those values as State<Boolean|Duration>.. 🤔

We should also introduce a rememberProgressButtonState() that returns that (remembered) state.

Users of the ProgressButton can simply put the state into the ProgressButton itself and update the state instead of calling the ProgressButton function again.

Does this make sense? 🤔

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

No branches or pull requests

1 participant