()
| 41 | const newURL = new URL(event.destination.url); |
| 42 | event.intercept({ |
| 43 | handler() { |
| 44 | let promise; |
| 45 | startTransition(() => { |
| 46 | addTransitionType('navigation-' + navigationType); |
| 47 | if (navigationType === 'traverse') { |
| 48 | // For traverse types it's useful to distinguish going back or forward. |
| 49 | const nextIndex = event.destination.index; |
| 50 | if (nextIndex > previousIndex) { |
| 51 | addTransitionType('navigation-forward'); |
| 52 | } else if (nextIndex < previousIndex) { |
| 53 | addTransitionType('navigation-back'); |
| 54 | } |
| 55 | } |
| 56 | promise = new Promise(resolve => { |
| 57 | setRouterState({ |
| 58 | url: newURL.pathname + newURL.search, |
| 59 | pendingNav: resolve, |
| 60 | }); |
| 61 | }); |
| 62 | }); |
| 63 | return promise; |
| 64 | }, |
| 65 | commit: 'after-transition', // plz ship this, browsers |
| 66 | }); |
| 67 | }); |
nothing calls this directly
no test coverage detected