import { useAppSelector } from './useAppSelector' ; import { useCallback } from 'react' ; import { useAppDispatch , useEffectLoading } from '../modal/ryan-store' ; import { articleList } from '../modal/articleList' ; export function useArticleList ( ) { const articleListState = useAppSelector ( 'articleList' ) ; const dispatch = useAppDispatch ( ) ; const effectLoading = useEffectLoading ( ) ; const reset = useCallback ( ( ) => { return dispatch ( articleList . reducers . reset ) ( ) ; } , [ dispatch ] ) ; const getList = useCallback ( ( payload ) => { return dispatch ( articleList . effects . getList ) ( payload ) ; } , [ dispatch ] ) ; const getAdminList = useCallback ( ( payload ) => { return dispatch ( articleList . effects . getAdminList ) ( payload ) ; } , [ dispatch ] ) ; return { articleListState , reset , getList , getListLoading : effectLoading ( articleList . effects . getList ) , getAdminList , getAdminListLoading : effectLoading ( articleList . effects . getAdminList ) , } ; }