ing
This commit is contained in:
parent
5d268cfbf7
commit
187a3ed10a
3
src/ts/@overflow/commons/di/decorators/index.ts
Normal file
3
src/ts/@overflow/commons/di/decorators/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export * from './inject';
|
||||||
|
export * from './injectable';
|
||||||
|
export * from './resource';
|
|
@ -21,7 +21,7 @@ export default class DispatchReducer {
|
||||||
|
|
||||||
private reducerMap: Map<string, any[]>;
|
private reducerMap: Map<string, any[]>;
|
||||||
|
|
||||||
public constructor() {
|
protected constructor() {
|
||||||
this.reducerMap = new Map();
|
this.reducerMap = new Map();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,12 @@ import {
|
||||||
AppContainer,
|
AppContainer,
|
||||||
} from 'react-hot-loader';
|
} from 'react-hot-loader';
|
||||||
|
|
||||||
|
import { Inject } from '@overflow/commons/di/decorators';
|
||||||
|
|
||||||
import config from './config';
|
import config from './config';
|
||||||
import DispatchReducer from '@overflow/commons/redux/dispatch_reducer';
|
import WebAppDispatchReducer from './redux/webapp_dispatch_reducer';
|
||||||
import WebApp from './pages/webapp';
|
import WebApp from './pages/webapp';
|
||||||
|
|
||||||
// declare let module: { hot: any };
|
// declare let module: { hot: any };
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@ -51,6 +54,9 @@ class WebAppApplication {
|
||||||
private store: Store<any>;
|
private store: Store<any>;
|
||||||
private history: History;
|
private history: History;
|
||||||
|
|
||||||
|
@Inject()
|
||||||
|
private dispatchReducer: WebAppDispatchReducer;
|
||||||
|
|
||||||
public constructor() {
|
public constructor() {
|
||||||
this.container = document.getElementById('appContainer');
|
this.container = document.getElementById('appContainer');
|
||||||
this.history = createHashHistory();
|
this.history = createHashHistory();
|
||||||
|
@ -59,7 +65,7 @@ class WebAppApplication {
|
||||||
public async run(): Promise<void> {
|
public async run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
this.renderLoading();
|
this.renderLoading();
|
||||||
let reducer: DispatchReducer = new DispatchReducer();
|
let reducer: WebAppDispatchReducer = new WebAppDispatchReducer();
|
||||||
reducer.registerReducers(config.redux.reducers);
|
reducer.registerReducers(config.redux.reducers);
|
||||||
this.store = createStore(reducer.reducer, config.redux.state);
|
this.store = createStore(reducer.reducer, config.redux.state);
|
||||||
|
|
||||||
|
|
12
src/ts/@overflow/webapp/redux/webapp_dispatch_reducer.ts
Normal file
12
src/ts/@overflow/webapp/redux/webapp_dispatch_reducer.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import {
|
||||||
|
Injectable,
|
||||||
|
} from '@overflow/commons/di/decorators';
|
||||||
|
|
||||||
|
import DispatchReducer from '@overflow/commons/redux/dispatch_reducer';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export default class WebAppDispatchReducer extends DispatchReducer {
|
||||||
|
public constructor() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user