refactor: change singleton registrations to lazy singleton for improved performance
This commit is contained in:
@@ -666,17 +666,17 @@ class StaffConnectorRepositoryImpl implements StaffConnectorRepository {
|
||||
class StaffMainModule extends Module {
|
||||
@override
|
||||
void binds(Injector i) {
|
||||
i.addSingleton<StaffConnectorRepository>(
|
||||
i.addLazySingleton<StaffConnectorRepository>(
|
||||
StaffConnectorRepositoryImpl.new,
|
||||
);
|
||||
|
||||
i.addSingleton(
|
||||
i.addLazySingleton(
|
||||
() => GetProfileCompletionUseCase(
|
||||
repository: i.get<StaffConnectorRepository>(),
|
||||
),
|
||||
);
|
||||
|
||||
i.addSingleton(
|
||||
i.addLazySingleton(
|
||||
() => StaffMainCubit(
|
||||
getProfileCompletionUsecase: i.get(),
|
||||
),
|
||||
@@ -772,7 +772,7 @@ StateError: Cannot emit new states after calling close
|
||||
|
||||
```dart
|
||||
// ✅ GOOD: Singleton registration
|
||||
i.addSingleton<ProfileCubit>(
|
||||
i.addLazySingleton<ProfileCubit>(
|
||||
() => ProfileCubit(useCase1, useCase2),
|
||||
);
|
||||
|
||||
|
||||
18
.github/PULL_REQUEST_TEMPLATE.md
vendored
18
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -2,6 +2,14 @@
|
||||
|
||||
<!-- Provide a clear and concise description of your changes -->
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Related Issues
|
||||
|
||||
<!-- Link any related issues using #issue_number -->
|
||||
|
||||
Closes #
|
||||
Related to #
|
||||
|
||||
---
|
||||
|
||||
@@ -33,15 +41,6 @@
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Related Issues
|
||||
|
||||
<!-- Link any related issues using #issue_number -->
|
||||
|
||||
Closes #
|
||||
Related to #
|
||||
|
||||
---
|
||||
|
||||
## ✅ Testing
|
||||
|
||||
<!-- Describe how you tested these changes -->
|
||||
@@ -93,7 +92,6 @@ Related to #
|
||||
|
||||
- [ ] Code quality and readability
|
||||
- [ ] Design patterns follow project conventions
|
||||
- [ ] Test coverage is adequate
|
||||
- [ ] Performance implications reviewed
|
||||
- [ ] Security concerns addressed
|
||||
- [ ] Documentation is complete
|
||||
|
||||
Reference in New Issue
Block a user