Skip to content

Commit 65fa6f6

Browse files
committed
feat: add shortcut for Form's validateOn params
1 parent eff62e0 commit 65fa6f6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extension Set where Element == ValidationEvent {
2+
static let all = Set(ValidationEvent.allCases)
3+
4+
static let submit = Set([ValidationEvent.submit])
5+
static let change = Set([ValidationEvent.change])
6+
static let blue = Set([ValidationEvent.blur])
7+
}

EffectorForms/Validator.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import Foundation
22

3-
public enum ValidationEvent {
4-
case submit, blur, change
3+
public enum ValidationEvent: CaseIterable {
4+
case submit
5+
case blur
6+
case change
57
}
68

79
public struct ValidationError<Value: Equatable>: Equatable {

0 commit comments

Comments
 (0)