-
Notifications
You must be signed in to change notification settings - Fork 20
not getting generations which are already loaded #76
Conversation
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.
This version of store was implemented in a way that every block was loaded once. I still don't understand why @sadiqevani has replaced it with the less efficient approach (block should be loaded even if it was loaded before).
The code in this PR is too complex, I propose to implement it as it was before.
src/store/modules/blocks/actions.js
Outdated
|
||
if (!generations.length) { | ||
return state.generations | ||
let height = await dispatch('height') |
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.
Use const
instead of let
where it is possible.
c60d561
to
a843474
Compare
@davidyuk Please have a look at the latest commits. |
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.
src/store/modules/blocks/state.js
Outdated
blocks: [], | ||
generations: [] | ||
generations: {}, | ||
hash_to_height: {} |
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.
Usually, we are using camelCase.
This commit removes multiple instance creation of epoch client in all the action methods. This reduces multiple api requests and hence the loading time.
… for getGenerationByHash
7e96826
to
4b802af
Compare
@davidyuk I rebased this on top of other PRs and made the suggested changes. Please review again. |
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.
In general it looks ok, probably later I will propose some improvements.
No description provided.