TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Sails-hook-pagify a SailsJS hook module for pagination

4 pointsby p0larboyover 9 years ago
Hi guys,<p>published my first NPM module: sails-hook-pagify<p>Link: https:&#x2F;&#x2F;github.com&#x2F;colintoh&#x2F;sails-hook-pagify<p>For the past few production nodejs app, my team realised that there was a common feature needed from the server by the mobile clients: <i></i>Infinite list loading<i></i>.<p>For that to work, the required API&#x27;s needs to be paginated. For example, `GET &#x2F;users?page=1`, `GET &#x2F;users?page=2`, ... etc.<p>In Sails JS, there is `paginate` method but it lacks metadata like total number of pages, presence of next&#x2F;prev page .. etc.<p>Hence, sails-hook-pagify was refactored out from the completed projects and into a installable hook that we can re-use for many other future projects.<p>Hope the module is useful for you too. Appreciate any comments on it. Cheers!

no comments

no comments