All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.maryk.datastore.shared.updates.Update.kt Maven / Gradle / Ivy

Go to download

Maryk is a Kotlin Multiplatform library which helps you to store, query and send data in a structured way over multiple platforms. The data store stores any value with a version, so it is possible to request only the changed data or live listen for updates.

The newest version!
package maryk.datastore.shared.updates

import maryk.core.models.IsRootDataModel
import maryk.core.properties.types.Key
import maryk.core.query.changes.IsChange
import maryk.core.values.Values

/** Describes an update on an object with [key] in [dataModel] with [version] */
sealed class Update(
    val dataModel: DM,
    val key: Key,
    val version: ULong
) : IsUpdateAction {
    class Addition(
        dataModel: DM,
        key: Key,
        version: ULong,
        val values: Values
    ): Update(dataModel, key, version)

    class Deletion(
        dataModel: DM,
        key: Key,
        version: ULong,
        val isHardDelete: Boolean
    ): Update(dataModel, key, version)

    class Change(
        dataModel: DM,
        key: Key,
        version: ULong,
        val changes: List
    ): Update(dataModel, key, version)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy