orbital-paging 0.1.1

Shared paging primitives (Page<T>, PageRequest) for Orbital apps
Documentation

Shared paging primitives for Orbital apps.

This crate provides [Page] and [PageRequest] — the canonical wire types for offset/limit pagination across all [leptos] server functions. Because it has no UI or framework dependencies, any crate in the workspace can depend on it without introducing cycles.

When the leptos feature is enabled, this crate also provides [use_paged_infinite_scroll] — a reusable hook that encapsulates the 4-signal + use_infinite_scroll callback pattern for paginated lists.

Example

use orbital_paging::{Page, PageRequest};

let request = PageRequest::new(0, 10);
assert_eq!(request.offset, 0);
assert_eq!(request.limit, 10);

let page: Page<String> = Page {
    items: vec!["a".into(), "b".into()],
    has_more: false,
    total_count: Some(2),
    next_request_offset: None,
};
assert!(!page.has_more);