Skip to content

Sessão de posts requisitados conforme a tela chega ao fim. Os posts são chamados de uma API fake.

Notifications You must be signed in to change notification settings

rb-cesar/infinite-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Infinite scroll

Sessão de posts requisitados conforme a tela chega ao fim.

Os posts são chamados de uma API fake.

Como fazer requisição dos dados:

  • Url e configurações e pedido
const url = 'https://jsonplaceholder.typicode.com/posts&_limit=5$_page=1'
const config = {
    method: 'GET',
    headers: {
        'Content-type': 'application/json',
        'Accept': 'application/json',
    },
    cache: 'no-cache' // Opcional
}
  • Obtendo os dados
fetch(url, config)
    .then(response => response.json())
    .then(res => console.log(res))
    .catch(error => console.log(error)) // Em caso de erro

About

Sessão de posts requisitados conforme a tela chega ao fim. Os posts são chamados de uma API fake.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published