manifold/web/hooks/use-prefetch.ts

15 lines
546 B
TypeScript
Raw Normal View History

import { usePrefetchUserBetContracts } from './use-contracts'
import { usePrefetchPortfolioHistory } from './use-portfolio-history'
2022-09-16 21:35:03 +00:00
import { usePrefetchProbChanges } from './use-prob-changes'
import { usePrefetchUserBets } from './use-user-bets'
export function usePrefetch(userId: string | undefined) {
const maybeUserId = userId ?? ''
return Promise.all([
usePrefetchUserBets(maybeUserId),
usePrefetchUserBetContracts(maybeUserId),
usePrefetchPortfolioHistory(maybeUserId, 'weekly'),
2022-09-16 21:35:03 +00:00
usePrefetchProbChanges(userId),
])
}