Skip to content

.onPreview not working when having set up defaultScope for whole SharedContainer #118

Closed Answered by hmlongco
davidpetrina asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure if this is the or just a problem, but manager stores caches, registrations, and options for the container. The following code basically creates a new manager every single time it's needed.

    var manager: ContainerManager {
        let manager = ContainerManager()
        manager.defaultScope = .singleton
        return manager
    }

At the very least that should be...

    var manager: ContainerManager = {
        let manager = ContainerManager()
        manager.defaultScope = .singleton
        return manager
    }()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidpetrina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants