Function providerCreator

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);
  container.register(
apiClientProvider({
serviceName: 'myApiClient',
}),
);