Skip to content

Commit

Permalink
feat: add shortcut for Form's validateOn params
Browse files Browse the repository at this point in the history
  • Loading branch information
r13v committed Jul 12, 2023
1 parent eff62e0 commit 65fa6f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions EffectorForms/Set+ValidationEvent.swift
Original file line number Diff line number Diff line change
@@ -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])
}
6 changes: 4 additions & 2 deletions EffectorForms/Validator.swift
Original file line number Diff line number Diff line change
@@ -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<Value: Equatable>: Equatable {
Expand Down

0 comments on commit 65fa6f6

Please sign in to comment.