2020-09-23 01:00:56 +00:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import Combine
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
public protocol CollectionViewModel {
|
2020-10-05 06:36:22 +00:00
|
|
|
var sections: AnyPublisher<[[CollectionItemIdentifier]], Never> { get }
|
2020-10-05 20:21:06 +00:00
|
|
|
var title: AnyPublisher<String, Never> { get }
|
2020-09-23 01:00:56 +00:00
|
|
|
var alertItems: AnyPublisher<AlertItem, Never> { get }
|
|
|
|
var loading: AnyPublisher<Bool, Never> { get }
|
2020-10-07 00:31:29 +00:00
|
|
|
var events: AnyPublisher<CollectionItemEvent, Never> { get }
|
2020-10-05 22:50:05 +00:00
|
|
|
var nextPageMaxId: String? { get }
|
2020-10-02 03:19:14 +00:00
|
|
|
var maintainScrollPositionOfItem: CollectionItemIdentifier? { get }
|
2020-10-05 22:50:05 +00:00
|
|
|
func request(maxId: String?, minId: String?)
|
2020-10-06 23:12:11 +00:00
|
|
|
func viewedAtTop(indexPath: IndexPath)
|
2020-10-05 07:50:59 +00:00
|
|
|
func select(indexPath: IndexPath)
|
|
|
|
func canSelect(indexPath: IndexPath) -> Bool
|
|
|
|
func viewModel(indexPath: IndexPath) -> CollectionItemViewModel
|
2020-09-23 01:00:56 +00:00
|
|
|
}
|