Skip to content

Setting values inside GetIt singletons directly #79

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

Closed
d-apps opened this issue May 19, 2020 · 1 comment
Closed

Setting values inside GetIt singletons directly #79

d-apps opened this issue May 19, 2020 · 1 comment

Comments

@d-apps
Copy link

d-apps commented May 19, 2020

Is it ok to set values inside variables of an instantiated class (singleton)?

I have an app that will create Stores from MobX as singletons but I will need to change the obsevable variables inside this classes in runtime.

abstract class Test extends with Store {

     @observable
     String name;

}

If so it's ok to do this:

Get.I<Store()>().name = "Test"

@escamoteur
Copy link
Collaborator

Sure absolutely

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