Fudge
07/26/2020, 3:13 PMAdam Powell
07/26/2020, 3:30 PMLeland Richardson [G]
07/27/2020, 12:03 AMRelnote:
https://android-review.googlesource.com/c/platform/frameworks/support/+/1326201The androidx.compose.frames package has been renamed to
androidx.compose.snapshots. The entire API has been
redesigned to be mores consistent and more documentation has
been added. The parts of the API that are likely to still
change have been marked experimental.
State objects returned by `mutableStateOf` and `state` no
longer require a snapshot or frame to read from or write to
them. The "Not in a frame" exception has been removed.
State objects can be read from and written to from any
thread.
A snapshot can be taken in any thread that preserves the
value of all state objects at the moment the snapshot
was taken. A mutable snapshot can also be take than allows
a snapshot consistent reads and writes of state objects.
Applying a mutable snapshot is an atomic operation and
all threads will see all changes made in the snapshot
simultaneously. Mutable snapshot can be disposed with
being applied. A changes made in a disposed mutable
snapshot that has not been applied are not visible to
any thread.
Both mutable and read-only snapshots can be nested where
changes to a nested snapshot are applied atomically to
its parent snapshot.
Collections have been revised to use immutable collections
internally and implement more of the MutableList and
MutableMap APIs. Snapshot collections are created by
calling `mutableStateListOf()` and `mutableStateMapOf()`.
Fudge
07/27/2020, 8:07 AMCollections have been revised to use immutable collections
internally and implement more of the MutableList and
MutableMap APIs
Doesn’t that make mutating operations on collections extremely slow? And what is the point of implementing with immutable collections if the api is mutable api anyway?Leland Richardson [G]
07/27/2020, 3:51 PM