File tree 3 files changed +23
-15
lines changed
3 files changed +23
-15
lines changed Original file line number Diff line number Diff line change 31
31
"rxjs" : " 0.0.0-PLACEHOLDER" ,
32
32
"@ngrx/store" : " 0.0.0-PLACEHOLDER" ,
33
33
"@ngrx/effects" : " 0.0.0-PLACEHOLDER"
34
+ },
35
+ "devDependencies" : {
36
+ "@daffodil/core" : " 0.0.0-PLACEHOLDER"
34
37
}
35
38
}
Original file line number Diff line number Diff line change 1
- import { InjectionToken } from '@angular/core' ;
2
1
import { Observable } from 'rxjs' ;
3
2
3
+ import { createMultiInjectionToken } from '@daffodil/core' ;
4
+
4
5
import { DaffAnalyticsEvent } from './event/event' ;
5
6
6
7
/**
@@ -39,9 +40,9 @@ export type DaffAnalyticsTrackerFunction = (event: DaffAnalyticsEvent) => Observ
39
40
*/
40
41
export type DaffAnalyticsTracker = DaffAnalyticsTrackerFunction | DaffAnalyticsTrackerClass ;
41
42
42
- /**
43
- * An injection token representing all of the different analytics trackers.
44
- */
45
- export const DaffAnalyticsServices = new InjectionToken < DaffAnalyticsTracker [ ] > ( 'DaffAnalyticsServices' , {
46
- factory : ( ) => [ ] ,
47
- } ) ;
43
+ export const {
44
+ /**
45
+ * An injection token representing all of the different analytics trackers.
46
+ */
47
+ token : DaffAnalyticsServices ,
48
+ } = createMultiInjectionToken < DaffAnalyticsTracker > ( 'DaffAnalyticsServices' ) ;
Original file line number Diff line number Diff line change 1
- import { InjectionToken } from '@angular /core' ;
1
+ import { createConfigInjectionToken } from '@daffodil /core' ;
2
2
3
3
/**
4
4
* The default analytics configuration. We intentionally do not track
@@ -20,10 +20,14 @@ export interface DaffAnalyticsConfigInterface {
20
20
analyzableActions : string [ ] ;
21
21
}
22
22
23
- /**
24
- * Allows you to provide configuration to the `@daffodil/analytics` package.
25
- */
26
- export const DaffAnalyticsConfig = new InjectionToken < DaffAnalyticsConfigInterface > ( 'DaffAnalyticsConfig' , {
27
- providedIn : 'root' ,
28
- factory : ( ) => defaultConfig ,
29
- } ) ;
23
+ export const {
24
+ /**
25
+ * Allows you to provide configuration to the `@daffodil/analytics` package.
26
+ */
27
+ token : DaffAnalyticsConfig ,
28
+ provider : daffProvideAnalyticsConfig ,
29
+ } = createConfigInjectionToken (
30
+ defaultConfig ,
31
+ 'DaffAnalyticsConfig' ,
32
+ { providedIn : 'root' } ,
33
+ ) ;
You can’t perform that action at this time.
0 commit comments