Skip to content

Commit d6f34e6

Browse files
committed
✨ Add Sendable to Dripper.State
1 parent 4ede790 commit d6f34e6

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

Sources/Dripper/Drip.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
public struct Drip<State: Observable, Action>: Dripper {
10+
public struct Drip<State: Observable & Sendable, Action>: Dripper {
1111

1212
// MARK: Properties
1313

Sources/Dripper/Dripper.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public typealias DripperOf<D: Dripper> = Dripper<D.State, D.Action>
1212
// MARK: - Dripper
1313

1414
public protocol Dripper<State, Action> {
15-
associatedtype State: Observable
15+
associatedtype State: Observable & Sendable
1616
associatedtype Action
1717
associatedtype Body
1818

@@ -24,7 +24,14 @@ public protocol Dripper<State, Action> {
2424

2525
extension Dripper where Body == Never {
2626
public var body: Body {
27-
fatalError()
27+
fatalError(
28+
"""
29+
'\(Self.self)' has no body. …
30+
31+
Do not access a dripper's 'body' property directly, as it may not exist. To run a dripper, \
32+
call 'Dripper.drip(_ state:_ action:)', instead.
33+
"""
34+
)
2835
}
2936
}
3037

Sources/Dripper/DripperBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99

1010
@resultBuilder
11-
public enum DripperBuilder<State: Observable, Action> {
11+
public enum DripperBuilder<State: Observable & Sendable, Action> {
1212
@inlinable
1313
public static func buildBlock<D: Dripper<State, Action>>(_ dripper: D) -> D {
1414
dripper

Sources/Dripper/Effect.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ extension Effect {
4040

4141
// MARK: Static Computed Properties
4242

43+
@inlinable
4344
public static var none: Self {
4445
Self { _ in }
4546
}

0 commit comments

Comments
 (0)