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

public properties #464

Open
nurk02 opened this issue Sep 18, 2023 · 3 comments
Open

public properties #464

nurk02 opened this issue Sep 18, 2023 · 3 comments

Comments

@nurk02
Copy link

nurk02 commented Sep 18, 2023

Hello! i enjoy using this framework and huge thanks to you for it. there is an issue we faced in our team while using it. I guess from some version of needle you have to change properties(child components) in component as public. Otherwise needle wouldn't be able to see dependency providers. Please update information about it in readme and other documentations.

Example:

final class RootComponent: BootstrapComponent {

//if it is only var someService: SomeServiceType (as internal) it won't work
public var someService: SomeServiceType {
let provider = MoyaProvider(plugins: [NetworkLoggerPlugin()])
return SomeServiceType(provider: provider)
}

//if it is only var someTracker: SomeServiceType (as internal) it won't work
public var someTracker: SomeTracker {
return shared { SomeTrackerImpl(storage: UserDefaultsStorage(),
rootModuleBuilder: self,
someService: someService)
}
}

Thank you. would be thankful if you mention me somewhere in this repo. Wish you all the best! :)

@shreesha-kedilaya
Copy link

Even i faced it. Is this a fix for some issue in the framework? Even i wouldn't like to use public for the dependencies used inside the same module.

@maiyama18
Copy link
Contributor

I've just started using needle and ran into the same issue, which was quite troublesome. Personally, I agree that I don’t want to use 'public' for use within the same module. But for the time being, I think it would be helpful if the documentation stated that 'public' should be used for the dependencies, to save time for new users.

xezero referenced this issue Mar 6, 2024
* Ignore internal properties in components

- Fixes #458 (see bug for details)

* Fix tests
@xezero
Copy link

xezero commented Mar 6, 2024

#459 This looks like the exact commit that completely changed how we're supposed to use Needle.

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

4 participants