I have a piece of code from an angular application like below,
{
provide: APP_INITIALIZER,
deps: [...config.mockApi.services],
useFactory: () => (): any => null,
multi: true,
}
I want to convert it to the newer provideAppInitializer syntax.
I have come up with the below code but it throws me an error.
provideAppInitializer(() => {
const initializerFn = ()=> (inject([...config.mockApi.services]));
return initializerFn();
}),
Argument of type '() => unknown' is not assignable to parameter of type '() => void | Observable | Promise'. Type 'unknown' is not assignable to type 'void | Observable | Promise'.ts(2345)
Why am I getting this error, and how can I fix it?