reactant-share
Version:
A framework for building shared web applications with Reactant
18 lines (16 loc) • 546 B
text/typescript
import { PluginModule, injectable } from 'reactant';
import type { ReducersMapObject } from 'redux';
()
export class IdentifierChecker extends PluginModule {
beforeCombineRootReducers = (reducers: ReducersMapObject) => {
Object.keys(reducers).forEach((key) => {
const [prefix, className] = key.split('/');
if (prefix === '@@reactant') {
console.error(
`The decorator for class ${className} should set "@injectable({ name: '${className}' })".`
);
}
});
return reducers;
};
}