Skip to content

Instantly share code, notes, and snippets.

@n8
Created March 17, 2016 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8/b7036e96761a98709ca7 to your computer and use it in GitHub Desktop.
Save n8/b7036e96761a98709ca7 to your computer and use it in GitHub Desktop.
var snapbackCache = SnapbackCache({
bodySelector: "mandatory selector of your infinite feed",
finish: function () {
optional method of something that needs to finish on your page before caching the page
},
removeAutofocus: function () {
optional method to kill autofocusing which screws with scrolling the page
},
refreshItems: function (dirtyThings) {
optional method to fetch fresh bits from your server you want to replace in the cache
},
nextPageOffset: function () {
optional method to fetch the current page your scrolled to. this is so you can track what page you should scroll next. see the page-cache:loaded event.
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment