-
Notifications
You must be signed in to change notification settings - Fork 5
Feat: Implement farms provider and background preloading #1096
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
base: development_app_layout
Are you sure you want to change the base?
Conversation
| } | ||
| } | ||
|
|
||
| final preloadingServiceProvider = Provider<PreloadingService>((ref) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we return
final preloadingServiceProvider = Provider<PreloadingService>((ref) {
return PreloadingService(
ref.read(walletsNotifier.notifier),
ref.read(farmsNotifier.notifier)
);
});
directly from here.
What do u think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But why? The PreloadingService uses a singleton pattern which ensures there is only one instance of it throughout the app. It's a simpler approach and we avoid creating multiple instances.
| if (!_reload) return; | ||
| if (!_loading && _isListed) { | ||
| try { | ||
| final wallets = <Wallet>[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why passing empty list ? we can pass the wallets from walletsNotifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm resetting the state before using refresh from wallet provider.
Changes
Performance improvements:
Related Issues
#1036
Tested Scenarios