injectable
injectable copied to clipboard
Parameters for singletons
Hey there guys,
really enjoying this plugin, awesome work!
I've been messing for a couple of days with following problem. I'm building a shared packages for some of the apps we develop at our company, which makes sense since many services are shared (e.g. our LoggerService
). That LoggerService
is a singleton class, which needs a parameter loggerName
so our logging backend knows the source of the logs. That parameter should be specifically set in each app that used the plugin.
I've seen other issues like this https://github.com/Milad-Akarie/injectable/issues/251 which state that passing parameters to a singleton does not make sense. However, I think my use case is legit and no so strange. Is anyone sharing singletons with a package?