All files / src/hooks useNavigationInfo.ts

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

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 21 22                      3x       22x 22x 29x        
import { create } from "zustand";
 
interface NavigationInfoState {
  pathDistance: string;
  pathDuration: string;
  isLoading: boolean;
  setPathDistance: (distance: string) => void;
  setPathDuration: (duration: string) => void;
  setIsLoading: (loading: boolean) => void;
}
 
const useNavigationInfo = create<NavigationInfoState>((set) => ({
  pathDistance: "0",
  pathDuration: "0",
  isLoading: false,
  setPathDistance: (distance) => set({ pathDistance: distance }),
  setPathDuration: (duration) => set({ pathDuration: duration }),
  setIsLoading: (loading) => set({ isLoading: loading }),
}));
 
export default useNavigationInfo;