hmlongco / Resolver

Swift Ultralight Dependency Injection / Service Locator framework
MIT License
2.15k stars 190 forks source link

Value types in Graph scope #143

Closed totidev closed 2 years ago

totidev commented 2 years ago

When using ResolverScopeGraph, only classes are cached. However, if you use ResolverScopeCache, then value types are also cached. Is there any reason for this difference? Graph is supposed to reuse services in a given resolution cycle - except this would only apply to classes, and value types would be created multiple times.

hmlongco commented 2 years ago

Think that was just an oversight. How heavy are your value types?

totidev commented 2 years ago

Not heavy at all - was just curious if there had been a reason for the difference. Thanks for answering.