Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction APIs #218

Open
russhwolf opened this issue Nov 26, 2024 · 0 comments
Open

Transaction APIs #218

russhwolf opened this issue Nov 26, 2024 · 0 comments

Comments

@russhwolf
Copy link
Owner

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()
}
@russhwolf russhwolf added this to the Unspecified 1.x release milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant