metatext/ViewModels/Sources/ViewModels/CollectionViewModel.swift

20 lines
795 B
Swift
Raw Normal View History

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 }
var navigationEvents: AnyPublisher<NavigationEvent, Never> { get }
2020-10-05 22:50:05 +00:00
var nextPageMaxId: String? { get }
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
}