@@ -14,7 +14,7 @@ import {
14
14
INITIAL_REDUCERS ,
15
15
REDUCER_FACTORY } from '@ngrx/store' ;
16
16
import { StoreDevtools , DevtoolsDispatcher } from './devtools' ;
17
- import { StoreDevtoolsConfig , StoreDevtoolsOptions , STORE_DEVTOOLS_CONFIG , INITIAL_OPTIONS , SHOULD_INSTRUMENT } from './config' ;
17
+ import { StoreDevtoolsConfig , StoreDevtoolsOptions , STORE_DEVTOOLS_CONFIG , INITIAL_OPTIONS } from './config' ;
18
18
import { DevtoolsExtension , REDUX_DEVTOOLS_EXTENSION , ReduxDevtoolsExtension } from './extension' ;
19
19
20
20
@@ -40,12 +40,8 @@ export function createReduxDevtoolsExtension() {
40
40
}
41
41
}
42
42
43
- export function createStateObservable ( shouldInstrument : boolean , injector : Injector ) {
44
- return shouldInstrument ? injector . get ( StoreDevtools ) . state : injector . get ( State ) ;
45
- }
46
-
47
- export function createReducerManagerDispatcher ( shouldInstrument : boolean , injector : Injector ) {
48
- return shouldInstrument ? injector . get ( DevtoolsDispatcher ) : injector . get ( ActionsSubject ) ;
43
+ export function createStateObservable ( devtools : StoreDevtools ) {
44
+ return devtools . state ;
49
45
}
50
46
51
47
export function noMonitor ( ) : null {
@@ -55,8 +51,7 @@ export function noMonitor(): null {
55
51
export function createConfig ( _options : StoreDevtoolsOptions ) : StoreDevtoolsConfig {
56
52
const DEFAULT_OPTIONS : StoreDevtoolsConfig = {
57
53
maxAge : false ,
58
- monitor : noMonitor ,
59
- shouldInstrument : IS_EXTENSION_OR_MONITOR_PRESENT ,
54
+ monitor : noMonitor
60
55
} ;
61
56
62
57
let options = typeof _options === 'function' ? _options ( ) : _options ;
@@ -69,10 +64,6 @@ export function createConfig(_options: StoreDevtoolsOptions): StoreDevtoolsConfi
69
64
return config ;
70
65
}
71
66
72
- export function createShouldInstrument ( injector : Injector , config : StoreDevtoolsConfig ) {
73
- return injector . get ( config . shouldInstrument ) ;
74
- }
75
-
76
67
@NgModule ( {
77
68
imports : [
78
69
StoreModule
@@ -101,25 +92,19 @@ export class StoreDevtoolsModule {
101
92
provide : REDUX_DEVTOOLS_EXTENSION ,
102
93
useFactory : createReduxDevtoolsExtension
103
94
} ,
104
- {
105
- provide : SHOULD_INSTRUMENT ,
106
- deps : [ Injector , STORE_DEVTOOLS_CONFIG ] ,
107
- useFactory : createShouldInstrument
108
- } ,
109
95
{
110
96
provide : STORE_DEVTOOLS_CONFIG ,
111
97
deps : [ INITIAL_OPTIONS ] ,
112
98
useFactory : createConfig
113
99
} ,
114
100
{
115
101
provide : StateObservable ,
116
- deps : [ SHOULD_INSTRUMENT , Injector ] ,
102
+ deps : [ StoreDevtools ] ,
117
103
useFactory : createStateObservable
118
104
} ,
119
105
{
120
106
provide : ReducerManagerDispatcher ,
121
- deps : [ SHOULD_INSTRUMENT , Injector ] ,
122
- useFactory : createReducerManagerDispatcher
107
+ useExisting : DevtoolsDispatcher
123
108
} ,
124
109
]
125
110
} ;
0 commit comments