Skip to content

Commit

Permalink
feat: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Mar 30, 2021
1 parent 8a22665 commit 79dee23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const useGetTodos = (stale) => {

useEffect(() => {
let didCancel = false;
const getTodos = (async () => {
const getTodos = async () => {
dispatch({ type: FetchState.FETCH_INIT });
try {
const data = await api.listDocuments(Server.collectionID);
Expand All @@ -47,7 +47,7 @@ export const useGetTodos = (stale) => {
dispatch({ type: FetchState.FETCH_FAILURE });
}
}
})();
};
getTodos();
return () => (didCancel = true);
}, [stale]);
Expand Down

0 comments on commit 79dee23

Please sign in to comment.