Skip to content

Transaction APIs #218

@russhwolf

Description

@russhwolf

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()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions