HookSniff.Pagination (hooksniff v1.2.0)

Pagination utilities for HookSniff SDK. Iterates through offset-based paginated endpoints.

Summary

Functions

Collect all items from a paginated endpoint.

Returns a Stream for lazy pagination.

Functions

collect_all(fetch_page, opts \\ [])

Collect all items from a paginated endpoint.

Parameters

  • fetch_page — Function that takes (limit, offset) and returns {:ok, %{data: [...], has_more: bool}}
  • opts — Options: :limit (default 50), :max_pages (default 100)

Returns

List of all items.

paginate(fetch_page, opts \\ [])

Returns a Stream for lazy pagination.