Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repositories is reinstantiated every access? #18

Open
JetForMe opened this issue Nov 24, 2021 · 2 comments
Open

Repositories is reinstantiated every access? #18

JetForMe opened this issue Nov 24, 2021 · 2 comments

Comments

@JetForMe
Copy link

There's a bit of code I don't understand, on

    var repositories: Repositories {
        .init(app: self)
    }

This results in Repositories being instantiated on every access.

@madsodgaard
Copy link
Owner

@JetForMe It's only Application.Repositories that is instantiated, that type is just a helper type for accessing the actual factory methods for repositories. The actual factory methods/closures are stored in app.storage with the Application.Repositories.Storage type, so they are persistent across the entire Application

@JetForMe
Copy link
Author

That's not what I see when I put a breakpoint there. It gets called multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants