Could I get some feedback on my state management? ...
# compose
Could I get some feedback on my state management? I've made a little game where the board is generated based on the current date and the selected board size. Is this simple example handling state appropriately? (Code in at the bottom.) [EDIT: Fixed link.]
This is what it looks like currently, to give some context.
The size and date start out based on some defaults, and have independent remember/mutableStateOf blocks. The board state is in a third block and has remember-keys based on the first two.
Note that the third line of text includes the size and date.
When the user clicks one of the new-game buttons, all three of the state objects are set to new values. (The date should stay consistent throughout a game, but should be re-computed when a new game is started.)
Link doesnt work ­čĄö
Oops! Fixed it.
I'm thinking that the remember block for the game board doesn't actually need keys specified, since it's not recomputed automatically.