lbry-desktop/ui/redux/selectors
infinite-persistence c97cab0ebb
byId[] fixes to reduce invalidation (#239)
* Don't update 'pendingById' if no changes.

'pendingById' isn't frequently updated, but using it as a proof-of-concept to fix how reducers should be written to avoid unnecessary updates.

ImmutableJS apparently does all of this for us, but there are cons to using it as well, so using own wrappers for now.

* Don't update 'byId' if no changes + add 'selectClaimWithId'

## Ticket
116 Claim store optimization ideas (reducing unnecessary renders)

## Changes
- Ignore things like `confirmations` so that already-fetched claims aren't invalidated and causes re-rendering. The `stringify` might look expensive, but the amount of avoided re-renders outweighs it. There might be faster ways to compare, though.

- With `byId[claimId]` references more stable now, memoized selectors can now use 'selectClaimWithId' to pick a specific claim to depend on, instead of 'byId' which changes on every update.

* Fix memo: selectMyChannelClaims, selectActiveChannelClaim

## Issue
These should never recalculate after `channel_list` has been fetched, but they do because of poor selector dependency.

## Change
With the `byId` changes from the previous commit, we are now able to memoize these selectors correctly.
2021-11-08 12:25:29 -05:00
..
app.js byId[] fixes to reduce invalidation (#239) 2021-11-08 12:25:29 -05:00
blocked.js Skip muted list update if no change 2021-10-19 21:15:26 +08:00
claims.js byId[] fixes to reduce invalidation (#239) 2021-11-08 12:25:29 -05:00
coinSwap.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
collections.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
comments.js Simplify superchat selectors - memo not required 2021-11-04 16:06:06 +08:00
content.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
file_info.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
livestream.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
notifications.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
publish.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
reactions.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
reportContent.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
rewards.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
search.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
settings.js Revert "Code-split homepages" 2021-10-28 01:33:46 +08:00
subscriptions.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
sync.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
tags.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
user.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00
wallet.js Don't memoize selectors without transformation 2021-10-24 13:05:06 +08:00