ReSwift-Router
ReSwift-Router copied to clipboard
Optional disable of pop action on setting route
I started playing around with this router for a WatchKit app I'm going to be working on. I realised that the router could not handle back button / swipe left navigation patterns without also triggering the pop func on the Routable when dispatching a SetRouteAction on willDisappear() (similarly to the GitHubBrowserExample). This PR takes an alternative approach to solving it by specifying a disablePopAction bool on the SetRouteAction. This means the pop() isn't called but the routable is removed from the array. Seems to work well from testing on a real Apple Watch.
Codecov Report
Merging #126 (03272ae) into master (5231c3e) will decrease coverage by
3.13%
. The diff coverage is26.31%
.
@@ Coverage Diff @@
## master #126 +/- ##
==========================================
- Coverage 92.74% 89.60% -3.14%
==========================================
Files 8 8
Lines 634 481 -153
==========================================
- Hits 588 431 -157
- Misses 46 50 +4
Impacted Files | Coverage Δ | |
---|---|---|
ReSwiftRouter/NavigationState.swift | 100.00% <ø> (ø) |
|
ReSwiftRouter/Router.swift | 79.52% <10.00%> (-5.25%) |
:arrow_down: |
ReSwiftRouter/NavigationReducer.swift | 81.48% <28.57%> (-18.52%) |
:arrow_down: |
ReSwiftRouter/NavigationActions.swift | 100.00% <100.00%> (ø) |
|
...iftRouterTests/ReSwiftRouterIntegrationTests.swift | 89.68% <0.00%> (-0.98%) |
:arrow_down: |
ReSwiftRouterTests/RouteHashSpec.swift | 100.00% <0.00%> (ø) |
|
...SwiftRouterTests/ReSwiftRouterTestsUnitTests.swift | 100.00% <0.00%> (ø) |
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 5231c3e...03272ae. Read the comment docs.