Pull2Refresh (Pull To Refresh)
A pull to refresh library without any dependency.
Screenshot
Example available here.
Installation
npm install --save pull2refresh
Usage
Pull down to refresh Item 1 Item 2 Item 3
API
Constructor
var p2r = pullableElement // Required. HTMLElement that can be pulled. refreshElement: HTMLElement; // Required. HTLMElement that will appear during pull. void; // Required. Callback that will be called at the end of the pull. onPull?: void; // Optionnal. Callback called during pull. A number between 0 and 1, representing the progression of the pull, is passed as argument of the callback. threshold?: number; // Optionnal. Threshold in pixel to reach to consider the pull finished. By default this threshold is the height of the refreshElement.;
done()
p2r;
Function to call to indicate the refresh is done.
After calling this function, the refreshElement
will be hidden and a new pull to refresh action can be done.
Build
# Build js library and type.d.ts file npm run build # Build minified js library and type.d.ts file npm run build:min
Licence
pull2refresh is released under the MIT license.