Giter Club home page Giter Club logo

lab12's Introduction

Open in Visual Studio Code

Client Side Pagination

Let us suppose that you are building a Pokémon client app that would use our Pokémon API server to get the data.

The client app will fetch all the Pokémons and paginate the Pokémons to a user. For example, you may choose to display 10 Pokémons at a time and allow the user to navigate back and forth using next and prev buttons. Or even better, choose a page number.

This means that instead of displaying all 809 Pokémons, you could have 81 pages with each page showing 10 records.

Here’s what the app looks like with pagination.

Additional Requirements

  • Show only 10 pages at a time
  • For each page, display the Pokémon in a responsive grid.
  • Hide the prev and next buttons if you are at the first or last pages, respectively.
  • Using CSS, highlight the selected page in the pagination controls.

Challenges

  • Cache the response in browser's localStorage so even if you close and reopen the browser, you don't have to fetch all the Pokémons again.

To Read

lab12's People

Contributors

sheybarpagga avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.