MCPcopy Create free account
hub / github.com/dailydotdev/apps / refreshShell

Function refreshShell

packages/shared/src/components/shell/shellRefresh.ts:64–82  ·  view source on GitHub ↗
(
  queryClient: QueryClient,
  { indicator = true }: { indicator?: boolean } = {},
)

Source from the content-addressed store, hash-verified

62 ]);
63
64export const refreshShell = async (
65 queryClient: QueryClient,
66 { indicator = true }: { indicator?: boolean } = {},
67): Promise<void> => {
68 const feeds = queryClient
69 .getQueryCache()
70 .findAll({ type: 'active', predicate: isRootFeed });
71
72 set(indicator);
73 try {
74 await bounded(
75 Promise.all(
76 feeds.map(({ queryKey }) => refreshFirstPage(queryClient, queryKey)),
77 ),
78 );
79 } finally {
80 set(false);
81 }
82};
83
84// The wrappers' pull to refresh, which shows its own spinner: a root's feed
85// refreshes as the lit tab refreshes it, any other page refetches what is on

Callers 2

activateFunction · 0.90
refreshPageFunction · 0.85

Calls 3

boundedFunction · 0.85
refreshFirstPageFunction · 0.85
setFunction · 0.70

Tested by

no test coverage detected