UNPKG

@macalinao/grill

Version:

Modern Solana development kit for React applications with automatic account batching, caching, and transaction notifications

20 lines 726 B
import { createAccountQueryKey } from "./account-helpers.js"; /** * Refetches the accounts for the given addresses * @param queryClient - The query client to invalidate the accounts for * @param addresses - The addresses to invalidate the accounts for */ export const refetchAccounts = async ({ queryClient, accountLoader, addresses, }) => { // Clear the cache for (const address of addresses) { accountLoader.clear(address); } // Refetch the queries await Promise.all(addresses.map(async (address) => { await queryClient.refetchQueries({ queryKey: createAccountQueryKey(address), exact: true, }); })); }; //# sourceMappingURL=refetch-accounts.js.map