O'Reilly logo

Socket.IO Cookbook by Tyson Cadenhead

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Doing server-side pagination

When you have a large amount of data, it is often beneficial to present it in paged format so that you don't have to load all of it at once. In this recipe, we will create an app with several pages of data that will require server-side pagination.

Getting ready

For this recipe, we will use a library called Chance to generate a large set of random data. Chance is composed of various functions that allow us to get all sorts of random data to test with. So, it is ideal to mock up data before you have any. It can be installed by running npm install chance in your command line.

How to do it…

To do server-side pagination using Socket.IO, follow these steps:

  1. First, we will create our new Cordova app by running cordova create app ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required