Migrate composables to a provider pattern, so watchers and composables register once. #537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current issue with a lot of token list lag was the fact that our composables were called many times. Given the fact that these composable instances are isolated, they would register their own watchers and computed properties multiple times as well.
Some of of these watchers and composables are quite hefty in the compute they perform, so it would essentially become a very expensive render every tim.
This PR aims to refactor that logic and move the more used composable contents to a provider pattern, so they are provided once (watchers and computables) registered once and a much needed speed improvement is introduced.
Fixes #TokenListsLagging
Type of change
How should this be tested?
Entire app, make sure invest works, withdraw works (balances update when so). Trading works (balances update)
Checklist:
master
if hotfix,develop
if not