Skip to content

About

Generic Combine operator to easily interact with paginated APIs

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

CombinePaginationFeedback

Swift Package Manager compatible

Generic Combine operator to easily interact with paginated APIs. Based on CombineFeedback.

Design

public typealias PageProvider<PageDependency, Element> = (PageDependency) -> AnyPublisher<Page<PageDependency, Element>, Error>

public static func paginationSystem<PageDependency, Element, S: Scheduler>(
    scheduler: S,
    initialDependency: PageDependency,
    loadNext: AnyPublisher<Void, Never>,
    pageProvider: @escaping PageProvider<PageDependency, Element>
) -> AnyPublisher<PaginationState<PageDependency, Element>, Never>

Features

  • Simple state machine to represent pagination use cases.
  • Reusable pagination logic. No need to duplicate state across different screens with paginated apis.
  • Observe state to react to loading event, latest error and changes on the list of elements.

About

Generic Combine operator to easily interact with paginated APIs

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages