This commit is contained in:
crusader 2017-12-26 19:54:54 +09:00
parent 187a3ed10a
commit 00583067cd
3 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1 @@
export * from './web_application';

View File

@ -0,0 +1,32 @@
import {
Annotation,
Decorator,
} from '@overflow/commons/core/reflect';
import {
ClassType,
MetadataKeyType,
PropertyKeyType,
TypeUtil,
} from '@overflow/commons/core/type';
export interface WebApplicationAnnotationAttributes {
injectables?: ClassType[];
configurations?: ClassType[];
}
export class WebApplicationAnnotation implements Annotation {
public readonly attributes: WebApplicationAnnotationAttributes;
public constructor(attributes: WebApplicationAnnotationAttributes) {
this.attributes = attributes;
}
public classDecorator<TFunction extends Function>(target: TFunction): TFunction | void {
console.log('WebApplication');
}
}
export const WebApplication = Decorator.create(WebApplicationAnnotation);

View File

@ -28,6 +28,7 @@ import {
AppContainer, AppContainer,
} from 'react-hot-loader'; } from 'react-hot-loader';
import { WebApplication } from '@overflow/commons/application/decorators';
import { Inject } from '@overflow/commons/di/decorators'; import { Inject } from '@overflow/commons/di/decorators';
import config from './config'; import config from './config';
@ -44,8 +45,14 @@ declare global {
const module: { hot: any }; const module: { hot: any };
} }
@WebApplication({
injectables: [
WebAppDispatchReducer,
],
configurations: [
],
})
class WebAppApplication { class WebAppApplication {
private static isProduction:boolean = process.env.NODE_ENV === 'production' ? true : false; private static isProduction:boolean = process.env.NODE_ENV === 'production' ? true : false;
private static useReduxDevTools:boolean = window.devToolsExtension && !WebAppApplication.isProduction ? true : false; private static useReduxDevTools:boolean = window.devToolsExtension && !WebAppApplication.isProduction ? true : false;