quintype-loadmore
v0.0.1
Published
quintype loadmore functionality for front end apps
Downloads
3
Readme
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:
- getStoriesFromResponse: Checking which API we are using api/v1/stories or api/v1/search and according to that returning stories array.
- 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:
- storyTemplate:
- 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.