Skip to content

Commit

Permalink
Merge pull request #10 from diamirio/sync-action-fix
Browse files Browse the repository at this point in the history
Add workaround for wrong behaviour when no Action type is present
  • Loading branch information
kaulex99 authored May 16, 2024
2 parents 0f89118 + b2e2333 commit 1f41856
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/AsyncReactor/AsyncReactor+SwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public struct ActionBinding<Reactor: AsyncReactor, Action, Value>: DynamicProper
target.wrappedValue.bind(keyPath, action: action as! (Value) -> Reactor.SyncAction)
}

if Action.self == Reactor.Action.self {
return bindAction()
} else if Action.self == Reactor.SyncAction.self {
if Action.self == Reactor.SyncAction.self {
return bindSyncAction()
} else if Action.self == Reactor.Action.self {
return bindAction()
} else {
fatalError("this should never happen :)")
}
Expand Down

0 comments on commit 1f41856

Please sign in to comment.