Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional disable of pop action on setting route #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lukefanning
Copy link

@lukefanning lukefanning commented Apr 22, 2020

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-io
Copy link

Codecov Report

Merging #126 (03272ae) into master (5231c3e) will decrease coverage by 3.13%.
The diff coverage is 26.31%.

Impacted file tree graph

@@            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%) ⬇️
ReSwiftRouter/NavigationReducer.swift 81.48% <28.57%> (-18.52%) ⬇️
ReSwiftRouter/NavigationActions.swift 100.00% <100.00%> (ø)
...iftRouterTests/ReSwiftRouterIntegrationTests.swift 89.68% <0.00%> (-0.98%) ⬇️
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants