Build with no warnings
This commit is contained in:
parent
be4587f7cc
commit
91a850563e
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user