@o3r/core 13.6.0-prerelease.7 → 13.6.0-prerelease.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/core",
|
|
3
|
-
"version": "13.6.0-prerelease.
|
|
3
|
+
"version": "13.6.0-prerelease.9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@ngrx/entity": "^20.0.0",
|
|
39
39
|
"@ngrx/store": "^20.0.0",
|
|
40
40
|
"@nx/angular": "~21.6.0",
|
|
41
|
-
"@o3r/telemetry": "~13.6.0-prerelease.
|
|
41
|
+
"@o3r/telemetry": "~13.6.0-prerelease.9",
|
|
42
42
|
"@schematics/angular": "^20.0.0",
|
|
43
43
|
"chokidar": "^4.0.3",
|
|
44
44
|
"globby": "^11.1.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@o3r/schematics": "~13.6.0-prerelease.
|
|
79
|
+
"@o3r/schematics": "~13.6.0-prerelease.9",
|
|
80
80
|
"tslib": "^2.6.2",
|
|
81
81
|
"uuid": "^11.0.5"
|
|
82
82
|
},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@ngrx/store": "~20.1.0",
|
|
89
89
|
"@ngrx/store-devtools": "~20.1.0",
|
|
90
90
|
"@nx/eslint-plugin": "~21.6.0",
|
|
91
|
-
"@o3r/store-sync": "~13.6.0-prerelease.
|
|
91
|
+
"@o3r/store-sync": "~13.6.0-prerelease.9",
|
|
92
92
|
"@stylistic/eslint-plugin": "~5.6.0",
|
|
93
93
|
"@types/jest": "~30.0.0",
|
|
94
94
|
"@typescript-eslint/eslint-plugin": "~8.51.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';
|
|
1
|
+
import { InjectionToken, ModuleWithProviders, NgModule, Optional } from '@angular/core';
|
|
2
2
|
import { Action, ActionReducer, StoreModule } from '@ngrx/store';
|
|
3
3
|
<%if (isAsync) {%>
|
|
4
4
|
import { EffectsModule } from '@ngrx/effects';
|
|
@@ -6,24 +6,35 @@ import { <%= storeName %>Effect } from './<%= fileName %>.effect';<%}%>
|
|
|
6
6
|
import { <%= cStoreName %>Reducer } from './<%= fileName %>.reducer';
|
|
7
7
|
import { <%= scuStoreName %>_STORE_NAME, <%= storeName %>State } from './<%= fileName %>.state';
|
|
8
8
|
|
|
9
|
+
/** Action Reducer map for <%= storeName %> store */
|
|
10
|
+
type <%= storeName %>ActionReducer<T extends <%= storeName %>State=<%= storeName %>State, V extends Action=Action> = ActionReducer<T, V>;
|
|
11
|
+
|
|
12
|
+
/** Internal Token of the <%= storeName %> reducer */
|
|
13
|
+
const INTERNAL_<%= scuStoreName %>_REDUCER_TOKEN = new InjectionToken<<%= storeName %>ActionReducer>('Internal <%= storeName %> Reducer');
|
|
14
|
+
|
|
9
15
|
/** Token of the <%= storeName %> reducer */
|
|
10
|
-
export const <%= scuStoreName %>_REDUCER_TOKEN = new InjectionToken
|
|
16
|
+
export const <%= scuStoreName %>_REDUCER_TOKEN = new InjectionToken<<%= storeName %>ActionReducer>('Feature <%= storeName %> Reducer');
|
|
11
17
|
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve default reducer for <%= storeName %> store
|
|
20
|
+
* @param customReducer
|
|
21
|
+
*/
|
|
22
|
+
export function get<%= storeName %>Reducer(customReducer: <%= storeName %>ActionReducer = <%= cStoreName %>Reducer): <%= storeName %>ActionReducer {
|
|
23
|
+
return customReducer;
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
@NgModule({
|
|
18
27
|
imports: [
|
|
19
|
-
StoreModule.forFeature(<%= scuStoreName %>_STORE_NAME, <%= scuStoreName %>_REDUCER_TOKEN)<%if (isAsync) {%>, EffectsModule.forFeature([<%= storeName %>Effect])<%}%>
|
|
28
|
+
StoreModule.forFeature(<%= scuStoreName %>_STORE_NAME, INTERNAL_<%= scuStoreName %>_REDUCER_TOKEN)<%if (isAsync) {%>, EffectsModule.forFeature([<%= storeName %>Effect])<%}%>
|
|
20
29
|
],
|
|
21
|
-
providers: [
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
providers: [{
|
|
31
|
+
provide: INTERNAL_<%= scuStoreName %>_REDUCER_TOKEN,
|
|
32
|
+
useFactory: get<%= storeName %>Reducer,
|
|
33
|
+
deps: [[new Optional(), <%= scuStoreName %>_REDUCER_TOKEN]]
|
|
34
|
+
}]
|
|
24
35
|
})
|
|
25
36
|
export class <%= storeName %>StoreModule {
|
|
26
|
-
public static forRoot<T extends <%= storeName %>State>(reducerFactory: () => ActionReducer<T
|
|
37
|
+
public static forRoot<T extends <%= storeName %>State>(reducerFactory: () => <%= storeName %>ActionReducer<T>): ModuleWithProviders<<%= storeName %>StoreModule> {
|
|
27
38
|
return {
|
|
28
39
|
ngModule: <%= storeName %>StoreModule,
|
|
29
40
|
providers: [
|