Enabled @typescript-eslint/no-unsafe-call eslint rule again

This commit is contained in:
Alejandro Celaya
2021-02-28 17:43:41 +01:00
parent 86544f4b24
commit 1fe76500e8
7 changed files with 18 additions and 13 deletions

View File

@@ -20,7 +20,8 @@ type LazyActionMap = Record<string, Function>;
const bottle = new Bottle();
const { container } = bottle;
const lazyService = (container: IContainer, serviceName: string) => (...args: any[]) => container[serviceName](...args);
const lazyService = <T extends Function>(container: IContainer, serviceName: string) =>
(...args: any[]) => (container[serviceName] as T)(...args);
const mapActionService = (map: LazyActionMap, actionName: string): LazyActionMap => ({
...map,
// Wrap actual action service in a function so that it is lazily created the first time it is called