All files / features/auth useAuthStatus.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 3/3
100% Lines 3/3

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                          1x   2x 4x    
import { create } from "zustand";
 
/**
 * Whether the auth session has resolved its first hydration (anonymous bootstrap +
 * user/couple docs loaded). The root gate shows a splash until then so a returning
 * or recovered user isn't flashed the onboarding flow before their state arrives.
 */
type AuthStatus = {
  ready: boolean;
  markReady: () => void;
  reset: () => void;
};
 
export const useAuthStatus = create<AuthStatus>((set) => ({
  ready: false,
  markReady: () => set({ ready: true }),
  reset: () => set({ ready: false }),
}));