1 min readOct 20, 2019
Depends on the Dependency Injection system. In Resolver, you’d register the service in the .application scope.
register { MyService() }.scope(application)
Resolver would then resolve it the first time it’s needed but cache the result such that any further resolutions will get the same object.
In Swinject, it would be the .container scope.
For more, see Resolver: Scopes.