quintype-loadmore v0.0.1
Quintype Load More Functionality for frontend apps
We are using the Libraries lodash and jquery
Creating private functions to make the code simpler and clean: 1) getStoriesFromResponse: Checking which API we are using api/v1/stories or api/v1/search and according to that returning stories array. 2) removeRepeatStories: This function will check for the story-id if it is already there then it will remove that story from the array 'stories'.
The Main quintypeLoadMore has two arguments storyTemplate and opts:
1. storyTemplate:
2. opts is an object
opts.params:- The value of limit for the next coming stories after clicking on load-more.
opts.offset:- This is the offset value.
opts.api:- By default the value of api is api/v1/stories.
opts.storyIds:- Array having Ids Of first page loaded stories. Eventually we are copying whatever inside the story into a variable loadedStoryIds.
7 years ago