feat: Adding more helpers, wip

This commit is contained in:
2024-05-30 17:48:34 -04:00
parent ee983f7337
commit 11ddfb04c3
5 changed files with 99 additions and 53 deletions

View File

@@ -0,0 +1,15 @@
import ComposableArchitecture
public protocol ReceiveAction<ReceiveAction> {
associatedtype ReceiveAction
static func receive(_ result: TaskResult<ReceiveAction>) -> Self
var result: TaskResult<ReceiveAction>? { get }
}
extension ReceiveAction {
public var result: TaskResult<ReceiveAction>? {
AnyCasePath(unsafe: Self.receive).extract(from: self)
}
}