diff --git a/src/Hooks/usePosts/usePosts.js b/src/Hooks/usePosts/usePosts.js index e37e331..6593dc2 100644 --- a/src/Hooks/usePosts/usePosts.js +++ b/src/Hooks/usePosts/usePosts.js @@ -5,8 +5,6 @@ import {DateTime} from 'luxon'; const usePosts = () => { - //const {result: cachedPosts, loading: cachedLoading} = useFetch( process.env.REACT_APP_SITE_URL + '/posts/posts.json'); - const [posts, setPosts] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(false); @@ -16,13 +14,8 @@ const usePosts = () => { fetch( process.env.REACT_APP_SITE_URL + '/posts/posts.json').then(response => response.json()).then((result) => { setPosts(result); setLoading(false); - //return; }); - - //setPosts([]); - //setLoading(true); - }, []); const getPost = (id) => { @@ -33,7 +26,6 @@ const usePosts = () => { return {posts, loading, getPost, publishedPosts} - }; export default usePosts; \ No newline at end of file