diff --git a/EffectorForms/Set+ValidationEvent.swift b/EffectorForms/Set+ValidationEvent.swift new file mode 100644 index 0000000..2c3da98 --- /dev/null +++ b/EffectorForms/Set+ValidationEvent.swift @@ -0,0 +1,7 @@ +extension Set where Element == ValidationEvent { + static let all = Set(ValidationEvent.allCases) + + static let submit = Set([ValidationEvent.submit]) + static let change = Set([ValidationEvent.change]) + static let blue = Set([ValidationEvent.blur]) +} diff --git a/EffectorForms/Validator.swift b/EffectorForms/Validator.swift index a77e814..f8053ef 100644 --- a/EffectorForms/Validator.swift +++ b/EffectorForms/Validator.swift @@ -1,7 +1,9 @@ import Foundation -public enum ValidationEvent { - case submit, blur, change +public enum ValidationEvent: CaseIterable { + case submit + case blur + case change } public struct ValidationError: Equatable {