ABSDKObjectDataSource
final public class ABSDKObjectDataSource<Operation, Data> : ABSDKDataSource
A data source that binds with an object type of data in a GraphQL operation and monitors its update
-
Init an object data source
Declaration
Swift
public init(client: ABSDKClient, operation: Operation, dataSourceMapper: @escaping ObjectDataSourceMapper<Operation, Data>, dataSourceUpdateHandler: @escaping DataSourceUpdateHandler)
Parameters
client
An ABSDKClient for sending requests
operation
A GraphQL operation to get the object
dataSourceMapper
A callback to extract the concerned object from the operation result
dataSourceUpdateHandler
A callback that gets called whenever the concerned object gets update
-
Get the concerned object
Declaration
Swift
public func getObject() -> Data?
-
Start observing on the operation related data
Declaration
Swift
public func observe()
-
Start observing on the operation related data
Declaration
Swift
public func observe() -> <Operation, Data> (ABSDKObjectDataSource<Operation, Data>) -> () -> ()