OrderFetchDelegate

public protocol OrderFetchDelegate : AnyObject

Notified of the OrderResult fetch

  • Called when the results have successfully been fetched

    • result: The OrderResult that was fetched and merged
    • identifier: A Hashable identifying the request that was made. This will be same identifier you passed to fetch orders call.

    Declaration

    Swift

    func orderFetchDidSucceedWith(_ result: OrderResult, identifier: AnyHashable?)
  • Called when there was an error fetching the results

    • error: The Error that caused the issue
    • identifier: A Hashable identifying the request that was made. This will be same identifier you passed to fetch orders call.

    Declaration

    Swift

    func orderFetchDidFailWith(_ error: Error, identifier: AnyHashable?)
  • previousResult() Default implementation

    Called before supplying the fetched results. This is your opportunity to return any previous (paged) results you had so the SDK can merge them for you. Default implementation of this method returns nil.

    Default Implementation

    Declaration

    Swift

    func previousResult() -> OrderResult?

    Return Value

    Any previous OrderResult that corresponds to the same OrderQuery. nil if none

  • orderFetchDidReceive(_:identifier:) Default implementation

    Called when the results have been fetched and merged. This method is called on a background thread and gives you the opportunity to substitute any buffering or volitile variables you may be holding. Default implementation of this method is a no-op.

    • result: The fetched and merged OrderResult
    • identifier: A Hashable identifying the request that was made. This will be same identifier you passed to fetch orders call.

    Default Implementation

    Declaration

    Swift

    func orderFetchDidReceive(_ result: OrderResult, identifier: AnyHashable?)