Content-Length: 291511 | pFad | http://github.com/magsdk/data-cacher

BE GitHub - magsdk/data-cacher: Caches data in a predetermined range.
Skip to content

magsdk/data-cacher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Cacher

build status npm version dependencies status devDependencies status Gitter

Caches data in a predetermined range.

Installation

npm install mag-data-cacher

Usage

Add the constructor to the scope:

var DataCacher = require('mag-data-cacher');

Create instance with custom config:

var dataCacher = new DataCacher({
        pageSize: 7,
        cacheSize: 2,
        request: {},
        getter: function ( callback, config, count ) {
            //
        }
    });

To check and get data for next page:

var callback = function ( error, receivedData ) {
    console.log(error);
    console.log(receivedData);
};

dataCacher.checkPrev(callback);

To check and get data for previous page:

dataCacher.checkNext(callback);

To check and get data for 1st page:

dataCacher.goHome(callback);

To check and get data for last page:

dataCacher.goEnd(callback);

To refresh data:

dataCacher.refreshData(callback);

Contribution

If you have any problems or suggestions please open an issue according to the contribution rules.

License

mag-data-cacher is released under the MIT License.









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/magsdk/data-cacher

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy