perf: optimize load of pagination items with caching

This commit is contained in:
Divlo
2022-08-24 17:22:55 +02:00
parent 19fc29ad47
commit ad64f1c571
16 changed files with 168 additions and 65 deletions

View File

@ -22,12 +22,15 @@ export const JoinGuildsPublic: React.FC = () => {
})
useEffect(() => {
authentication.socket.on('guilds', (data: SocketData<GuildPublicType>) => {
handleSocketData({ data, setItems })
})
authentication?.socket?.on(
'guilds',
(data: SocketData<GuildPublicType>) => {
handleSocketData({ data, setItems })
}
)
return () => {
authentication.socket.off('guilds')
authentication?.socket?.off('guilds')
}
}, [authentication.socket, setItems])