mirror of
https://github.com/ershisan99/it-incubator-todolist-ts-17-live-2024-08-17.git
synced 2026-02-04 21:02:13 +00:00
chore: refactor auth reducer to export selectors
This commit is contained in:
@@ -22,6 +22,7 @@ import { AddItemForm } from 'components/AddItemForm/AddItemForm'
|
||||
import { Todolist } from './Todolist/Todolist'
|
||||
import { Navigate } from 'react-router-dom'
|
||||
import { useAppDispatch } from 'hooks/useAppDispatch'
|
||||
import { selectIsLoggedIn } from 'features/Login/auth-reducer'
|
||||
|
||||
type Props = {
|
||||
demo?: boolean
|
||||
@@ -32,9 +33,7 @@ export const TodolistsList: React.FC<Props> = ({ demo = false }) => {
|
||||
(state) => state.todolists
|
||||
)
|
||||
const tasks = useSelector<AppRootState, TasksState>((state) => state.tasks)
|
||||
const isLoggedIn = useSelector<AppRootState, boolean>(
|
||||
(state) => state.auth.isLoggedIn
|
||||
)
|
||||
const isLoggedIn = useSelector(selectIsLoggedIn)
|
||||
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user