-
Notifications
You must be signed in to change notification settings - Fork 62
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
TW-830: Collectibles Manage dropdown #925
Conversation
const { slugs, checksum } = useMemo(() => { | ||
const slugs = collectibles.map(({ tokenSlug }) => tokenSlug); | ||
|
||
const checksum = slugs.sort().join('+'); |
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.
you can add in deps slugs.length
and remove checksum
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.
Those are not the same
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.
Then what is the checksum
?
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.
The kind of dependency, that will only change, when slugs' values change. Not a link to the slugs array, but actual values. That's why I sort them first and then put together in one string.
collectibles
(link to object) may change, then slugs
(link to object) may change, while checksum
will stay the same.
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.
firefox done
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.
Chrome done
https://madfish.atlassian.net/browse/TW-830