Some of the APIs beneath Multiplatform Settings support transactional operations, though many don't. Examples include SharedPreferences, DataStore, and the Windows Registry. I've considered adding support for this on the implementations where it's possible, via a TransactionalSettings interface somewhat analagous to ObservableSettings. I'd love to hear from the community if this is something people would find useful or have opinions on. One issue is that some of the more commonly-used implementations, including everything on iOS, do not support this natively as far as I am aware.
API would look something like this, though I haven't tried prototyping anything yet.
interface TransactionalSettings : Settings {
fun beginTransaction(): Transactor
}
interface Transactor {
fun putInt(key: String, value: Int)
...
fun commit()
}
Some of the APIs beneath Multiplatform Settings support transactional operations, though many don't. Examples include SharedPreferences, DataStore, and the Windows Registry. I've considered adding support for this on the implementations where it's possible, via a
TransactionalSettingsinterface somewhat analagous toObservableSettings. I'd love to hear from the community if this is something people would find useful or have opinions on. One issue is that some of the more commonly-used implementations, including everything on iOS, do not support this natively as far as I am aware.API would look something like this, though I haven't tried prototyping anything yet.