yola / drf-paginator Goto Github PK
View Code? Open in Web Editor NEWJS module for consuming paginated Django Rest Framework endpoints
License: MIT License
JS module for consuming paginated Django Rest Framework endpoints
License: MIT License
The goal is to make pagination easier to deal with for our clients. Clients have request functions in the form of request(queryParams)
that return a promise for the response.
The paginator wraps a request and provides a clean API for returning promises for the results of each page.
new Paginator(request, queryParams)
: constructor that takes a request and query params for said requestpaginator.next()
: returns the next page.
queryParams
during initialization of the paginator.paginator.previous()
: returns the previous page
next
in that it will return cached responses or make new requestsPaginator.all(request, queryParams)
: returns a promise for all the pages of an endpoint concatenated together as a single result listWhile not needed for MVP, we'd like the paginator object to support the additional methods:
paginator.first()
: returns the first page and sets the current page to the first onepaginator.last()
: returns the last page and sets current page to itpaginator.current()
: returns the current page, which should be the same promise that was last returned by next
or previous
.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.