Skip to content

Commit

Permalink
conforming RealmTransaction to Equatable
Browse files Browse the repository at this point in the history
  • Loading branch information
natemann committed Sep 1, 2020
1 parent 2b6f6f3 commit ad5e94d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Sources/RealmExtensions/RealmTransaction.swift
Expand Up @@ -3,9 +3,12 @@ import RealmSwift


public struct RealmTransaction {

public let transaction: (Realm) -> ()


fileprivate let uuid: UUID = UUID()


public init(transaction: @escaping (Realm) -> ()) {
self.transaction = transaction
}
Expand Down Expand Up @@ -106,9 +109,17 @@ public struct RealmTransaction {
public static var empty: RealmTransaction {
.init(f: {})
}

}


extension RealmTransaction: Equatable {
public static func == (lhs: Self, rhs: Self) -> Bool {
lhs.uuid == rhs.uuid
}

}


extension Array where Element == RealmTransaction {

Expand Down

0 comments on commit ad5e94d

Please sign in to comment.