All files / extensions/default/src/stores useToggleOneUpViewportGridStore.ts

60% Statements 3/5
100% Branches 0/0
33.33% Functions 1/3
50% Lines 2/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    34x                     34x            
import { create } from 'zustand';
 
const PRESENTATION_TYPE_ID = 'toggleOneUpViewportGridId';
 
type ToggleOneUpViewportGridState = {
  toggleOneUpViewportGridStore: any | null;
  setToggleOneUpViewportGridStore: (state: any) => void;
  clearToggleOneUpViewportGridStore: () => void;
  type: string;
};
 
// Stores the entire ViewportGridService getState when toggling to one up
// (e.g. via a double click) so that it can be restored when toggling back.
export const useToggleOneUpViewportGridStore = create<ToggleOneUpViewportGridState>(set => ({
  toggleOneUpViewportGridStore: null,
  type: PRESENTATION_TYPE_ID,
  setToggleOneUpViewportGridStore: state => set({ toggleOneUpViewportGridStore: state }),
  clearToggleOneUpViewportGridStore: () => set({ toggleOneUpViewportGridStore: null }),
}));