-
Notifications
You must be signed in to change notification settings - Fork 911
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
why is languagestore, themestore, userstore registered in service_locator #126
Comments
I notice the same because the UserStore builder was being called twice. I changed my code to: - final ThemeStore _themeStore = ThemeStore(getIt<Repository>());
- final PostStore _postStore = PostStore(getIt<Repository>());
- final LanguageStore _languageStore = LanguageStore(getIt<Repository>());
- final UserStore _userStore = UserStore(getIt<UserRepository>());
+ final ThemeStore _themeStore = getIt<ThemeStore>();
+ final PostStore _postStore = getIt<PostStore>();
+ final LanguageStore _languageStore = getIt<LanguageStore>();
+ final UserStore _userStore = getIt<UserStore>(); I'm still learning Dart so I don't know if this was made on purpose or if this is a bug 🤷♂️ |
@tribal2 thanks buddy! I think it's a bug as it double-initializes the store. |
Apologies for the delay. The latest changes have been merged into the main branch, and the issue should now be resolved. Please pull the latest changes and let us know if you encounter any further issues.
|
I notice in feature/mvi branch (the latest) that languagestore, themestore, userstore is registered in service_locator AS well as new'd up again in MyApp. This seems like duplication
i.e.
getIt.registerSingleton(LanguageStore(getIt()));
getIt.registerSingleton(ThemeStore(getIt()));
getIt.registerSingleton(UserStore(getIt()));
and also in my_app.dart
final ThemeStore _themeStore = ThemeStore(getIt());
final PostStore _postStore = PostStore(getIt());
final LanguageStore _languageStore = LanguageStore(getIt());
final UserStore _userStore = UserStore(getIt());
The text was updated successfully, but these errors were encountered: