-
Notifications
You must be signed in to change notification settings - Fork 59
/
globals.ts
57 lines (49 loc) · 1.39 KB
/
globals.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { StateParams } from './params/stateParams';
import { StateDeclaration } from './state/interface';
import { StateObject } from './state/stateObject';
import { Transition } from './transition/transition';
import { Queue } from './common/queue';
import { Disposable } from './interface';
/**
* Global router state
*
* This is where we hold the global mutable state such as current state, current
* params, current transition, etc.
*/
export class UIRouterGlobals implements Disposable {
/**
* Current parameter values
*
* The parameter values from the latest successful transition
*/
params: StateParams = new StateParams();
/**
* Current state
*
* The to-state from the latest successful transition
*/
current: StateDeclaration;
/**
* Current state (internal object)
*
* The to-state from the latest successful transition
* @internal
*/
$current: StateObject;
/**
* The current started/running transition.
* This transition has reached at least the onStart phase, but is not yet complete
*/
transition: Transition;
/** @internal */
lastStartedTransitionId = -1;
/** @internal */
transitionHistory = new Queue<Transition>([], 1);
/** @internal */
successfulTransitions = new Queue<Transition>([], 1);
dispose() {
this.transitionHistory.clear();
this.successfulTransitions.clear();
this.transition = null;
}
}