enum Payloadextension HistoryItem.Payload : SendableThe payload of the history item.
-
A state change.
Declaration
Swift
typealias TraitChange = (typeID: String, oldValue: Data, newValue: Data) -
An event.
Declaration
Swift
case event(data: TraitPayload) -
A set of state changes.
Declaration
Swift
case stateChange(changes: [HistoryItem.Payload.TraitChange]) -
Decodes an event from the given data.
Declaration
Swift
static func decode<E>(_ data: TraitPayload, as type: E.Type = E.self) throws -> E where E : Event -
Decodes a state change of the given type from the given data.
Declaration
Swift
static func decode<T>(_ change: HistoryItem.Payload.TraitChange, keyPath: KeyPath<HistoryItem.Payload.TraitChange, Data> = \.newValue, as type: T.Type = T.self) throws -> T where T : Trait