Crate leptos_windowing

Crate leptos_windowing 

Source
Expand description

Base crate for virtualization and pagination for Leptos.

This crate contains common code for the crates leptos-pagination and leptos-virtualization. You probably want don’t want to use this crate directly.

§Loading data

Wether you use pagination or virtualization you have to provide the data to display. This is done through implementing one of the various Loader traits. Depending on your use case you should implement the trait that best fits your needs:

  • MemoryLoader: If your dataset is already in memory like in a Vec, HashSet, array, …
  • PaginatedLoader: If your data source provides data in pages (independent of if you use UI pagination or virtualization).
  • ExactLoader: If your data source can provide an exact range of items (start index to end index).
  • Loader: If none of the above fit your needs, you can implement this trait to provide your own loading logic.

Please refer to the documentation and the examples to see how to implement these traits.

Modules§

cache
hook
item_state

Structs§

ExactLoaderMarker
ItemWindow
This is bascially a signal of a slice of the internal cache.
LoadedItems
Return type of Loader::load_items.
LoaderMarker
MemoryLoaderMarker
PaginatedLoaderMarker

Enums§

PaginatedCount
Return type of PaginatedLoader::count.

Traits§

ExactLoader
Trait for loading items on-demand from an data source that let’s you request precise ranges.
InternalLoader
This is the trait for the actually used internal loaders. This trait is automatically implemented for all the user facing loader traits.
Loader
Loader trait for loading items on-demand from a data source.
MemoryLoader
Loader trait for loading items on-demand from an in-memory data source.
PaginatedLoader
Loader trait for loading items on-demand from a paginated data source.