Update

public struct Update
extension Persister.Update: Hashable where Value: Hashable
extension Persister.Update: Equatable where Value: Equatable

An update that was performed by a persister.

  • Create and return a new Update for a persisted value.

    Declaration

    Swift

    public static func persisted(_ persistedValue: Value) -> Update

    Parameters

    persistedValue

    The value that was persisted.

    Return Value

    The created Update.

  • Create and return a new Update for a removed value.

    Declaration

    Swift

    public static func removed(defaultValue: Value) -> Update

    Parameters

    defaultValue

    The default value that will be falled back to.

    Return Value

    The created Update.

  • An event that triggers an update.

    See more

    Declaration

    Swift

    public enum Event
    extension Persister.Update.Event: Hashable where Value: Hashable
    extension Persister.Update.Event: Equatable where Value: Equatable
  • The new value, after the update. If the value was removed this will be the default value.

    Declaration

    Swift

    public let newValue: Value
  • The event that triggered the update.

    Declaration

    Swift

    public let event: Event