Closed matt-ramotar closed 10 months ago
Any progress on this PR?
@OliverRhyme Hey there - Sorry to be slow. No progress. This is not on our roadmap for Store5 stable. We will keep thinking about this. Completely open to contributions
When would this be released?
Released earlier today!
Closes #250
Technical Design Doc: Native Paging Support in Store5
Context and Scope
Feature request: MobileNativeFoundation/Store#250
This proposal addresses the need for paging support in Store. This enhancement aims to provide a simple, efficient, and flexible way to handle complex operations on large datasets.
Goals and Non-Goals
Goals
Non-Goals
The Actual Design
APIs
StoreKey
An interface that defines keys used by Store for data-fetching operations. Allows Store to load individual items and collections of items. Provides mechanisms for ID-based fetch, page-based fetch, and cursor-based fetch. Includes options for sorting and filtering.
StoreData
An interface that defines items that can be uniquely identified. Every item that implements the
StoreData
interface must have a means of identification. This is useful in scenarios when data can be represented as singles or collections.KeyProvider
An interface to derive keys based on provided data.
StoreMultiCache
depends onKeyProvider
to:Implementations
StoreMultiCache
Thread-safe caching system with collection decomposition. Manages data with utility functions to get, invalidate, and add items to the cache. Depends on
StoreMultiCacheAccessor
for internal data management. Should be used instead ofMultiCache
.StoreMultiCacheAccessor
Thread-safe intermediate data manager for a caching system supporting list decomposition. Tracks keys for rapid data retrieval and modification.
LaunchPagingStore
Main entry point for the paging mechanism. This will launch and manage a
StateFlow
that reflects the current state of the Store.Usage
StoreKey Example
StoreData Example
LaunchPagingStore Example
Degree of Constraint
StoreData
interface, ensuring they can be uniquely identified.StoreKey
interface.Deprecations
Alternatives Considered
Tailored Solution for Paging
Direct integration with Paging3
Paging3 doesn’t have built-in support for:
Custom
StoreKey
andStoreData
StructuresLoose Typing
Annotations and Reflection
Functional Programming Approach
Cross-Cutting Concerns
Future Directions