MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / getPosts

Function getPosts

assets/js/infiniteScroll.js:9–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8// Fetch posts from API
9async function getPosts() {
10 const res = await fetch(
11 `https://jsonplaceholder.typicode.com/posts?_limit=${limit}&_page=${page}`
12 );
13
14 const data = await res.json();
15
16 return data;
17}
18
19// Show posts in DOM
20async function showPosts() {

Callers 1

showPostsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected