Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 18x 18x 18x 142x 141x 141x 127x 141x | import { useMemo } from "react"; import { useCustomContext } from "./useCustomContext"; import UserContext, { IUserContext } from "../context/UserContext"; interface IUseAuth extends IUserContext { isPremium: boolean; } export function useAuth(): IUseAuth { const context = useCustomContext(UserContext); const isPremium = useMemo( () => context.user?.product === "premium", [context.user?.product] ); return { ...context, isPremium }; } |