Skip to content

Instantly share code, notes, and snippets.

@jdkealy
Created January 13, 2017 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdkealy/43e623f16f53711dfe6ab2f8cf269d8e to your computer and use it in GitHub Desktop.
Save jdkealy/43e623f16f53711dfe6ab2f8cf269d8e to your computer and use it in GitHub Desktop.
(defn paginate-all-ents [page pp _db & [return-ent?]]
(let [_drop (* page pp)]
(->> (d/seek-datoms (db/_d) :avet :content/fk)
(drop _drop)
(take pp)
(map (fn [_datom]
(if return-ent?
(ret-rec
(db/by-id (nth _datom 0 ) _db))
(nth _datom 0 ))))
vec)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment