Closed corban123 closed 3 years ago
Is the expectation that if you want to be able to clear it, you'll want to use the Cache scope?
Basically. All of the scopes are currently static let values and can't be replaced. The application scope exists for objects whose lifetime equals the entire lifetime of the application.
If you want to cache a set of objects for a certain period of time and then clear them out, use the built-in cache scope or you can also define your own scope on Resolver.
extension Resolver {
public static let session = ResolverScopeCache()
}
Then at some point in the process call Resolver.session.reset()
.
Makes sense, works for me. Thanks for clarifying!
That said... I'm not sure it makes sense to have a global reset that doesn't reset everything... so fixed in 1.3.
Issue: Upon calling
Resolver.reset()
,registerAllServices()
is called, however, upon checking the data of an Application-scope object, the data has not been resetRepro steps:
Expectation: Bool is set back to original value
Actual: Bool has not changed.
Unsure if this expectation is correct but would appreciate some sort of resolution