This repository was archived by the owner on Sep 6, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +21
-1
lines changed
internals/generators/container Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { RouterState } from 'connected-react-router';
33import { ContainerState as LanguageProviderState } from 'containers/LanguageProvider/types' ;
44import { ContainerState as AppState } from 'containers/App/types' ;
55import { ContainerState as HomeState } from 'containers/HomePage/types' ;
6+ // [IMPORT NEW CONTAINERSTATE ABOVE] < Needed for generating continers seamlessly
67
78export interface InjectedStore extends Store {
89 injectedReducers : any ;
@@ -30,6 +31,8 @@ export interface ApplicationRootState {
3031 readonly global : AppState ;
3132 readonly language : LanguageProviderState ;
3233 readonly home : HomeState ;
34+ // [INSERT NEW REDUCER KEY ABOVE] < Needed for generating continers seamlessly
35+
3336 // for testing purposes
3437 readonly test : any ;
3538}
Original file line number Diff line number Diff line change 1+ readonly {{ camelCase name }} : {{ properCase name }} State;
2+ // [INSERT NEW REDUCER KEY ABOVE] < Needed for generating continers seamlessly
Original file line number Diff line number Diff line change 1+ import { ContainerState as {{ properCase name }} State } from 'containers/{{ properCase name }} /types';
2+ // [IMPORT NEW CONTAINERSTATE ABOVE] < Needed for generating continers seamlessly
Original file line number Diff line number Diff line change @@ -184,6 +184,20 @@ module.exports = {
184184 templateFile : './container/types.d.hbs' ,
185185 abortOnFail : true ,
186186 } ) ;
187+ actions . push ( {
188+ type : 'modify' ,
189+ path : '../../app/types/index.d.ts' ,
190+ pattern : new RegExp ( / .* \/ \/ .* \[ I M P O R T N E W C O N T A I N E R S T A T E A B O V E \] .+ \n \n * / ) ,
191+ templateFile : './container/importContainerState.hbs' ,
192+ abortOnFail : true ,
193+ } ) ;
194+ actions . push ( {
195+ type : 'modify' ,
196+ path : '../../app/types/index.d.ts' ,
197+ pattern : new RegExp ( / .* \/ \/ .* \[ I N S E R T N E W R E D U C E R K E Y A B O V E \] .+ \n \n * / ) ,
198+ templateFile : './container/appendApplicationRootState.hbs' ,
199+ abortOnFail : true ,
200+ } ) ;
187201 }
188202
189203 actions . push ( {
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ interface Props {}
4545
4646function {{ properCase name }} (props: Props) {
4747 {{ #if wantActionsAndReducer }}
48- // Warning: Add your key to RootState in types/index.d.ts file
4948 useInjectReducer({ key: '{{ camelCase name }} ', reducer: reducer });
5049 {{ /if }}
5150 {{ #if wantSaga }}
You can’t perform that action at this time.
0 commit comments