Selector refactors #7424

Merged
jessopb merged 5 commits from selectorRefactors into master 2022-01-20 02:46:01 +01:00

5 commits

Author SHA1 Message Date
infinite-persistence
d31017e8e1 Cost Info selector fixes
- no memo required since they are just directly accessing the store.
2022-01-19 20:29:05 -05:00
infinite-persistence
831c85273a Simplify makeSelectIsUriResolving
- Memo not required. `resolvingUris` is very dynamic and is a short array anyways.
- Changeg from using `indexOf` to `includes`, which is more concise.
2022-01-19 20:10:04 -05:00
infinite-persistence
383cf30264 Simplify makeSelectTitleForUri
No need to memo given no transformation.
2022-01-19 20:05:28 -05:00
infinite-persistence
1ba6fd3c73 Fix and optimize makeSelectIsSubscribed (#273)
- It will not return true if the uri provided is canonical, because the compared subscription uri is in permanent form. This was causing certain elements like the Heart to not appear in claim tiles.
- It is super slow for large subscriptions not just because of the array size + being a hot selector, but also because it is looking up the claim twice (not memo'd) and also calling `parseURI` to determine if it's a channel, which is unnecessary if you already have the claim.

- Optimize the selector to only look up the claim once, and make operations using already-obtained info.
2022-01-19 18:27:21 -05:00
infinite-persistence
049b1c727e Attempt to speed up sidebar menu for mobile (#283)
* Exclude default homepage data at compile time

The youtuber IDs alone is pretty huge, and is unused in the `CUSTOM_HOMEPAGE=true` configuration.

* Remove Desktop items and other cleanup

- Moved constants out of the component.
- Remove SIMPLE_SITE check.
- Remove Desktop-only items

* Sidebar: limit subscription and tag section

Too slow for huge lists

Limit to 10 initially, and load everything on "Show more"

* Fix makeSelectThumbnailForUri

- Fix memo
- Expose function to extract directly from claim if client already have it.
2022-01-19 18:08:39 -05:00