Repository navigation
Feat: rememberSaveableWrapper gives Python Compose's rememberSaveable - #176
Merged
Merged
Conversation
…#174) As the original pycomposeui did: Int, Long, Double, Boolean and String initial values go to rememberSaveable { mutable*StateOf }, anything else is refused by type. Saved values come back through a SaveableStateRegistry. Red before: 3 of 3 RememberSaveableRenderTest failed (No module named 'python.multiplatform.compose').
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #174
Feature added: python.multiplatform.compose.rememberSaveableWrapper(initial: Any?): MutableState<>, following the original pycomposeui wrapper: Int, Long, Double, Boolean, String go to rememberSaveable { mutableStateOf }; any other type is refused naming it. Called through the binder inside a composition (the binder supplies the composer). pythonx-compose wraps it as remember_saveable with getValue()/setValue()/.value.
Test added: RememberSaveableRenderTest (3): every supported type survives performSave, scene teardown and restore from the saved map; with no registry the recreated scene shows initial values; a Python list is refused naming 'list'. Red before: 3/3 failed. Spec: SPEC B-9.
Verified: compose fixture 123 tests, first run 1 failure in the known intermittent #157 test, then 2 of 2 reruns green; artifact 37/0; :python-multiplatform-compose:compileReleaseKotlinAndroid OK. Core library untouched.