fixed perf issue related to too many rerenders

rerenders were caused by strict equality check on object/array picks
switched artistInfo to new store
updated zustand and fixed deprecation warnings
This commit is contained in:
austinried
2022-03-19 09:52:01 +09:00
parent 47c65ea8cb
commit 13af6555d3
15 changed files with 108 additions and 142 deletions

View File

@@ -1,10 +1,9 @@
import GradientFlatList from '@app/components/GradientFlatList'
import ListItem from '@app/components/ListItem'
import { useFetchList, useFetchList2 } from '@app/hooks/list'
import { useFetchList2 } from '@app/hooks/list'
import { PlaylistListItem } from '@app/models/music'
import { selectMusic } from '@app/state/music'
import { useStore } from '@app/state/store'
import React, { useCallback, useState } from 'react'
import { useStore, useStoreDeep } from '@app/state/store'
import React from 'react'
import { StyleSheet } from 'react-native'
const PlaylistRenderItem: React.FC<{ item: PlaylistListItem }> = ({ item }) => (
@@ -14,7 +13,7 @@ const PlaylistRenderItem: React.FC<{ item: PlaylistListItem }> = ({ item }) => (
const PlaylistsList = () => {
const fetchPlaylists = useStore(store => store.fetchLibraryPlaylists)
const { refreshing, refresh } = useFetchList2(fetchPlaylists)
const playlists = useStore(store => store.entities.playlists)
const playlists = useStoreDeep(store => store.entities.playlists)
return (
<GradientFlatList