Const
Creates an object like a provider, but that it can also be used as a function, as it normally expose options for the resources it will configure.
const apiClientProvider = providerCreator( ({ serviceName = 'apiClient' }) => (app) => { app.set(serviceName, () => new APIClient()); }, ); container.register(apiClientProvider); Copy
const apiClientProvider = providerCreator( ({ serviceName = 'apiClient' }) => (app) => { app.set(serviceName, () => new APIClient()); }, ); container.register(apiClientProvider);
container.register( apiClientProvider({ serviceName: 'myApiClient', }), ); Copy
container.register( apiClientProvider({ serviceName: 'myApiClient', }), );
Creates an object like a provider, but that it can also be used as a function, as it normally expose options for the resources it will configure.