# Selection Syncs each step of duty or occupant selections of user with redis backend. ```typescript // Create the selection hook using the factory const useContextSelection = createContextHook({ endpoint: "/context/dash/selection", contextName: "selection", enablePeriodicRefresh: false, }); // Custom hook for selection data with the expected interface interface UseSelectionResult { selectionData: ClientSelection | null; isLoading: boolean; error: string | null; refreshSelection: () => Promise; updateSelection: (newSelection: ClientSelection) => Promise; } // Wrapper hook that adapts the generic hook to the expected interface export function useSelection(): UseSelectionResult { const { data, isLoading, error, refresh, update } = useContextSelection(); return { selectionData: data, isLoading, error, refreshSelection: refresh, updateSelection: update, }; } ```