import { useSelector } from "react-redux" ; import { selectors as todosSelectors } from '../slices/todos' ; import { RootState } from ".." ; import { Todo , TodoId } from "../../api" ; export function useTodos ( ) { return useSelector ( ( state ) => todosSelectors . selectAll ( state . todos ) ) ; } export function useTodo ( id ) { return useSelector ( ( state ) => todosSelectors . selectById ( state . todos , id ) ) ; }