1 | {
|
2 | "version": 3,
|
3 | "file": "ignoredTransition.js",
|
4 | "sourceRoot": "",
|
5 | "sources": [
|
6 | "@uirouter/core/hooks/ignoredTransition.ts"
|
7 | ],
|
8 | "names": [],
|
9 | "mappings": ";;;AAAA,yCAAwC;AACxC,6DAAwD;AAIxD;;;;;;;GAOG;AACH,SAAS,WAAW,CAAC,KAAiB;IACpC,IAAM,aAAa,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,CAAC,aAAa;QAAE,OAAO;IAE3B,aAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAEpC,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;IAEhD,kEAAkE;IAClE,iEAAiE;IACjE,4EAA4E;IAC5E,IAAI,aAAa,KAAK,eAAe,IAAI,OAAO,EAAE;QAChD,OAAO,CAAC,KAAK,EAAE,CAAC;KACjB;IAED,OAAO,yBAAS,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;AACzC,CAAC;AAEY,QAAA,6BAA6B,GAAG,UAAC,iBAAoC;IAChF,OAAA,iBAAiB,CAAC,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;AAAhE,CAAgE,CAAC",
|
10 | "sourcesContent": [
|
11 | "import { trace } from '../common/trace';\nimport { Rejection } from '../transition/rejectFactory';\nimport { TransitionService } from '../transition/transitionService';\nimport { Transition } from '../transition/transition';\n\n/**\n * A [[TransitionHookFn]] that skips a transition if it should be ignored\n *\n * This hook is invoked at the end of the onBefore phase.\n *\n * If the transition should be ignored (because no parameter or states changed)\n * then the transition is ignored and not processed.\n */\nfunction ignoredHook(trans: Transition) {\n const ignoredReason = trans._ignoredReason();\n if (!ignoredReason) return;\n\n trace.traceTransitionIgnored(trans);\n\n const pending = trans.router.globals.transition;\n\n // The user clicked a link going back to the *current state* ('A')\n // However, there is also a pending transition in flight (to 'B')\n // Abort the transition to 'B' because the user now wants to be back at 'A'.\n if (ignoredReason === 'SameAsCurrent' && pending) {\n pending.abort();\n }\n\n return Rejection.ignored().toPromise();\n}\n\nexport const registerIgnoredTransitionHook = (transitionService: TransitionService) =>\n transitionService.onBefore({}, ignoredHook, { priority: -9999 });\n"
|
12 | ]
|
13 | } |
\ | No newline at end of file |