any suggestions, how to trigger an action after some delay, while being properly remembered across configuration changes? I want to disable a button for 1 minute and re-enabled it after a that time.
m
Marcin Wisniowski
11/16/2023, 2:39 PM
Sounds unrelated to Compose, the only thing in Compose should be a boolean telling the UI if the button is enabled or not
➕ 1
Depending on your architecture, if for example you have a ViewModel for that UI, the ViewModel could persist the last action timestamp to disk, and based on that switch the state that Compose consumes.
p
Peter
11/16/2023, 2:47 PM
um, makes sense. Not sure what was I thinking 😅 Thank you "correcting my course" 😄
c
Colton Idle
11/16/2023, 6:00 PM
Yeah, came here to say that. You could do this in compose I suppose. but Compose UI is really meant to just read state, and paint stuff on the screen