Closed StevenLambion closed 4 years ago
Merging #23 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #23 +/- ##
====================================
Coverage 60% 60%
====================================
Files 15 15
Lines 410 410
====================================
Hits 246 246
Misses 164 164
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 83be78d...ed85493. Read the comment docs.
This PR fixes cases where the View fails to refresh correctly after dispatching an action. The exact cause is unknown, but is due to internal implementation details of SwiftUI.
To fix this problem, the actionDispatcher is now added to the MappedState itself as an environment value. It's unused by MappedState, but SwiftUI will still attach subscribers to it. This replaces the manual subscription that published updates to the corresponding StateConnection<_>. For some unknown reason, this would stop working after one or more refreshes.