this repo has no description
0
fork

Configure Feed

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

Throttle account fetches

+6 -1
+6 -1
src/components/status.jsx
··· 11 11 import { decodeBlurHash, getBlurHashAverageColor } from 'fast-blurhash'; 12 12 import { shallowEqual } from 'fast-equals'; 13 13 import prettify from 'html-prettify'; 14 + import pThrottle from 'p-throttle'; 14 15 import { Fragment } from 'preact'; 15 16 import { memo } from 'preact/compat'; 16 17 import { ··· 77 78 const SHOW_COMMENT_COUNT_LIMIT = 280; 78 79 const INLINE_TRANSLATE_LIMIT = 140; 79 80 81 + const throttle = pThrottle({ 82 + limit: 1, 83 + interval: 1000, 84 + }); 80 85 function fetchAccount(id, masto) { 81 86 return masto.v1.accounts.$select(id).fetch(); 82 87 } 83 - const memFetchAccount = pmem(fetchAccount); 88 + const memFetchAccount = pmem(throttle(fetchAccount)); 84 89 85 90 const visibilityText = { 86 91 public: 'Public',