Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Poll Statsig for config changes (#3158)

authored by

dan and committed by
GitHub
aad8c080 7899a6fd

+24
+12
src/lib/statsig/statsig.tsx
··· 48 48 () => toStatsigUser(currentAccount?.did), 49 49 [currentAccount?.did], 50 50 ) 51 + 52 + React.useEffect(() => { 53 + function refresh() { 54 + // Intentionally refetching the config using the JS SDK rather than React SDK 55 + // so that the new config is stored in cache but isn't used during this session. 56 + // It will kick in for the next reload. 57 + Statsig.updateUser(currentStatsigUser) 58 + } 59 + const id = setInterval(refresh, 3 * 60e3 /* 3 min */) 60 + return () => clearInterval(id) 61 + }, [currentStatsigUser]) 62 + 51 63 return ( 52 64 <StatsigProvider 53 65 sdkKey="client-SXJakO39w9vIhl3D44u8UupyzFl4oZ2qPIkjwcvuPsV"
+12
src/lib/statsig/statsig.web.tsx
··· 48 48 () => toStatsigUser(currentAccount?.did), 49 49 [currentAccount?.did], 50 50 ) 51 + 52 + React.useEffect(() => { 53 + function refresh() { 54 + // Intentionally refetching the config using the JS SDK rather than React SDK 55 + // so that the new config is stored in cache but isn't used during this session. 56 + // It will kick in for the next reload. 57 + Statsig.updateUser(currentStatsigUser) 58 + } 59 + const id = setInterval(refresh, 3 * 60e3 /* 3 min */) 60 + return () => clearInterval(id) 61 + }, [currentStatsigUser]) 62 + 51 63 return ( 52 64 <StatsigProvider 53 65 sdkKey="client-SXJakO39w9vIhl3D44u8UupyzFl4oZ2qPIkjwcvuPsV"