Pagination in Clojure

Luminus – Pagination

I’ve recently been working on a fun side project using the Luminus web framework as my first foray into Clojure (which I’m absolutely falling in love with)

One thing however I find missing from the documentation and in general online is an idiomatic way to paginate in Clojure. I’m sure there is some sexy pagination strategy that uses lazy-seqs, macros, protocols and records however I was not able to come up with anything (myself or via google).

I’m dumping my small helper functions that I ended up writing in hopes that perhaps someone finds use for it:

Ultimately one would use the create function to include in their context/response a structured Pagination map.

If you have anything better please share!

Leave a Reply

Your email address will not be published. Required fields are marked *