Skip to content

Commit fa7d476

Browse files
authored
Merge pull request #6 from Lickability/adds-default-action-implementation
Adds default `Never` action type
2 parents 818aa1c + 6ef32b4 commit fa7d476

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/ViewStore/ViewStore.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ public protocol ViewStore: ObservableObject {
2323
/// - Parameter action: The action to perform.
2424
func send(_ action: Action)
2525
}
26+
27+
/// Default implementation that allows stores with no actions to send to ignore this function requirement in the protocol.
28+
public extension ViewStore {
29+
func send(_ action: Never) {}
30+
}

0 commit comments

Comments
 (0)