Build with no warnings

This commit is contained in:
Daniel Weissmall 2022-11-13 02:17:34 +03:00
parent be4587f7cc
commit 91a850563e

View File

@ -12,15 +12,27 @@ function useArticleViewModel(
const { id } = useParams();
const getArticle = useCallback(
(articleID: string) => {
(
articleID: string,
getArticleUseCase: GetArticleUseCase,
fetchArticleUseCase: FetchArticleUseCase
) => {
getArticleUseCase.call(articleID).catch((_) => fetchArticleUseCase.call(articleID));
},
[id]
[]
);
useEffect(() => {
getArticle(id ?? '');
}, [id]);
useEffect(
() => {
getArticle(id ?? '', getArticleUseCase, fetchArticleUseCase);
},
[
id,
getArticle,
getArticleUseCase,
fetchArticleUseCase
],
);
return {
article: store.currentArticle,