ing
This commit is contained in:
parent
187a3ed10a
commit
00583067cd
1
src/ts/@overflow/commons/application/decorators/index.ts
Normal file
1
src/ts/@overflow/commons/application/decorators/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './web_application';
|
|
@ -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);
|
|
@ -28,6 +28,7 @@ import {
|
|||
AppContainer,
|
||||
} from 'react-hot-loader';
|
||||
|
||||
import { WebApplication } from '@overflow/commons/application/decorators';
|
||||
import { Inject } from '@overflow/commons/di/decorators';
|
||||
|
||||
import config from './config';
|
||||
|
@ -44,8 +45,14 @@ declare global {
|
|||
const module: { hot: any };
|
||||
}
|
||||
|
||||
@WebApplication({
|
||||
injectables: [
|
||||
WebAppDispatchReducer,
|
||||
],
|
||||
configurations: [
|
||||
|
||||
|
||||
],
|
||||
})
|
||||
class WebAppApplication {
|
||||
private static isProduction:boolean = process.env.NODE_ENV === 'production' ? true : false;
|
||||
private static useReduxDevTools:boolean = window.devToolsExtension && !WebAppApplication.isProduction ? true : false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user