CREditorDataFlow.swift 654 B

123456789101112131415161718192021222324252627282930
  1. import Foundation
  2. enum CREditor {
  3. enum Config {}
  4. class Item: Identifiable, Hashable, Equatable {
  5. let id = UUID()
  6. var rateIndex = 0
  7. var timeIndex = 0
  8. init(rateIndex: Int, timeIndex: Int) {
  9. self.rateIndex = rateIndex
  10. self.timeIndex = timeIndex
  11. }
  12. static func == (lhs: Item, rhs: Item) -> Bool {
  13. lhs.timeIndex == rhs.timeIndex
  14. }
  15. func hash(into hasher: inout Hasher) {
  16. hasher.combine(timeIndex)
  17. }
  18. }
  19. }
  20. protocol CREditorProvider: Provider {
  21. var profile: CarbRatios { get }
  22. func saveProfile(_ profile: CarbRatios)
  23. }