This commit is contained in:
crusader 2017-12-24 11:58:22 +09:00
parent 1461c2a76d
commit 795b91d4f8

View File

@ -46,15 +46,26 @@ export default class LPCReducer {
*/
public registerReducers(reducerTypes: ClassType[]): void {
for (let reducerType of reducerTypes) {
this.registerReducer(reducerType);
}
}
/**
* registerReducer
*/
public registerReducer(reducerType: ClassType): void {
let clazz: Class = Class.forClass(reducerType);
let ra: ReducerAnnotation = clazz.getOwnAnnotation(ReducerAnnotation);
if (undefined === ra) {
continue;
console.warn(`Class is not Reducer type. add @Reducer annotation to class[${reducerType.name}]`);
return;
}
console.log(`name: ${ra.attributes.name}`);
let reducerMapping: string = null;
let ama: ActionMappingAnnotation = clazz.getOwnAnnotation(ActionMappingAnnotation);
if (undefined === ama) {
continue;
if (undefined !== ama) {
reducerMapping = ama.attributes.value;
}
console.log(`actionMapping-value: ${ama.attributes.value}`);
@ -70,14 +81,4 @@ export default class LPCReducer {
});
}
}
/**
* registerReducer
*/
public registerReducer(reducerType: ClassType): void {
console.log(``);
}
}