Link

class Link

ClosureChain sequentially executes try-blocks, also known as Links. Links must receive exactly one of either a .success() or a .throw() to signfiy the completion of the Link.

  • Signify a successful completion of a Link.

    Declaration

    Swift

    public func success(_ param: Any? = nil)

    Parameters

    param

    An optional parameter may be specified, to be passed to the next Link (try-block)

  • Any Link may throw by calling .throw(Error) or throw Error

    Declaration

    Swift

    public func `throw`(_ error: Error)
  • Convenience method to call success() or throw as appropriate for the given Result

    Declaration

    Swift

    public func `return`<RequiredType>(_ result: Result<RequiredType, Error>)

    Parameters

    result

    Result to evaluate