this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

memo all the things

Somehow things got slower on local dev

+12 -8
+3 -2
src/components/background-service.jsx
··· 1 + import { memo } from 'preact/compat'; 1 2 import { useEffect, useRef, useState } from 'preact/hooks'; 2 3 3 4 import { api } from '../utils/api'; ··· 5 6 import useInterval from '../utils/useInterval'; 6 7 import usePageVisibility from '../utils/usePageVisibility'; 7 8 8 - export default function BackgroundService({ isLoggedIn }) { 9 + export default memo(function BackgroundService({ isLoggedIn }) { 9 10 // Notifications service 10 11 // - WebSocket to receive notifications when page is visible 11 12 const [visible, setVisible] = useState(true); ··· 89 90 }); 90 91 91 92 return null; 92 - } 93 + });
+3 -2
src/components/keyboard-shortcuts-help.jsx
··· 1 1 import './keyboard-shortcuts-help.css'; 2 2 3 + import { memo } from 'preact/compat'; 3 4 import { useHotkeys } from 'react-hotkeys-hook'; 4 5 import { useSnapshot } from 'valtio'; 5 6 ··· 8 9 import Icon from './icon'; 9 10 import Modal from './modal'; 10 11 11 - export default function KeyboardShortcutsHelp() { 12 + export default memo(function KeyboardShortcutsHelp() { 12 13 const snapStates = useSnapshot(states); 13 14 14 15 function onClose() { ··· 161 162 </Modal> 162 163 ) 163 164 ); 164 - } 165 + });
+3 -2
src/components/notification-service.jsx
··· 1 + import { memo } from 'preact/compat'; 1 2 import { useLayoutEffect, useState } from 'preact/hooks'; 2 3 import { useSnapshot } from 'valtio'; 3 4 ··· 14 15 import Modal from './modal'; 15 16 import Notification from './notification'; 16 17 17 - export default function NotificationService() { 18 + export default memo(function NotificationService() { 18 19 if (!('serviceWorker' in navigator)) return null; 19 20 20 21 const snapStates = useSnapshot(states); ··· 179 180 } 180 181 181 182 return null; 182 - } 183 + });
+3 -2
src/components/search-command.jsx
··· 1 1 import './search-command.css'; 2 2 3 + import { memo } from 'preact/compat'; 3 4 import { useRef, useState } from 'preact/hooks'; 4 5 import { useHotkeys } from 'react-hotkeys-hook'; 5 6 6 7 import SearchForm from './search-form'; 7 8 8 - export default function SearchCommand({ onClose = () => {} }) { 9 + export default memo(function SearchCommand({ onClose = () => {} }) { 9 10 const [showSearch, setShowSearch] = useState(false); 10 11 const searchFormRef = useRef(null); 11 12 ··· 64 65 /> 65 66 </div> 66 67 ); 67 - } 68 + });