RootDataSource
public final class RootDataSource: iRootDataSource
Fetches RootSection
that holds a sequence of DataSources for lists of Category
and Viewable
data sources.
let rootDS = RootDataSource(withConfiguration: self.yaddoConfig, forPath: "root-vod")
rootDS.state.bind { state in
switch state {
///No request is currently active
case .idle: break
///Request is active
case .loading: break
///Request succeeded with response
case let .success(sections): print(sections)
///Request failed
case .error: break
}
}
rootDS.startRequest()
The list of ´RootSection` has datasources that follows the same pattern. You would want to join all of them together.
-
State for the data source, observable using the
Bindable
classDeclaration
Swift
public fileprivate(set) var state: Bindable<DataSourceState<RootSection>> = Bindable(.idle)
-
Initializer.
Declaration
Swift
public convenience init(withConfiguration configuration:MagineKitConfiguration, forPath path:String)
-
Starts a request.
Declaration
Swift
public func startRequest()
-
Cancels current request if any.
Declaration
Swift
public func cancelRequest()