feature/improved-article-content-loading #179

Merged
danysmall merged 7 commits from feature/improved-article-content-loading into develop 2022-11-12 23:19:40 +00:00
Showing only changes of commit d755be1f95 - Show all commits

View File

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