mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-15 11:40:37 +00:00
24 lines
535 B
Swift
24 lines
535 B
Swift
import Combine
|
|
import Models
|
|
import Observation
|
|
import SwiftUI
|
|
|
|
public enum StatusesState {
|
|
public enum PagingState {
|
|
case hasNextPage, none
|
|
}
|
|
|
|
case loading
|
|
case display(statuses: [Status], nextPageState: StatusesState.PagingState)
|
|
case error(error: Error)
|
|
}
|
|
|
|
@MainActor
|
|
public protocol StatusesFetcher {
|
|
var statusesState: StatusesState { get }
|
|
func fetchNewestStatuses(pullToRefresh: Bool) async
|
|
func fetchNextPage() async throws
|
|
func statusDidAppear(status: Status)
|
|
func statusDidDisappear(status: Status)
|
|
}
|