inversify-binding-decorators
inversify-binding-decorators copied to clipboard
Usage with ESLint
When you're using a class as the type, you get the error: @typescript-eslint/no-use-before-define.
I'd rather not disable this line. Any chance to make @provide() without any arguments passed in default to the class type?
#186
I encountered the error ReferenceError: Cannot access before initialization, and I really need this pull requests.
If someone want to use this pull request without any modifying original source before merging,
Use your own decorator like
import { interfaces } from 'inversify';
import { provide } from 'inversify-binding-decorators';
function provideAuto(serviceIdentifier?: interfaces.ServiceIdentifier<any>, force?: boolean) {
return function (target: any) {
const result = provide(serviceIdentifier || target, force)(target);
return result;
};
}
export default provideAuto;