Updated view model for article

This commit is contained in:
Daniel Weissmall 2022-11-13 01:16:11 +03:00
parent e20831fbfc
commit d755be1f95

View File

@ -11,17 +11,16 @@ function useArticleViewModel(
) { ) {
const { id } = useParams(); const { id } = useParams();
// const getArticle = useCallback( const getArticle = useCallback(
// () => { (articleID: string) => {
// getArticleUseCase.call(id ?? '').catch((_) => fetchArticleUseCase.call(id ?? '')); getArticleUseCase.call(articleID).catch((_) => fetchArticleUseCase.call(articleID));
// console.log(id); },
// }, [id]
// [id] );
// );
useEffect(() => { useEffect(() => {
getArticleUseCase.call(id ?? '').catch((_) => fetchArticleUseCase.call(id ?? '')); getArticle(id ?? '');
}, []); }, [id]);
return { return {
article: store.currentArticle, article: store.currentArticle,