WebcomPromisable

public protocol WebcomPromisable

A callback-based type that is wrapped by another type in order to enrich it with a PromiseKit-based API.

The wrapping type has an API similar to that of the wrapped type:

  • methods having a callback parameter in the wrapped type are replaced with methods returning a promise in the wrapping type,
  • other methods and properties keep the same signature and the wrapping type just forward the call to the wrapped instance.

Requirements

  • The type of the wrapping instance, which has a PromiseKit-based API.

    To use this type, import the following dependency in your code:

    import WebcomPromises
    

    Declaration

    Swift

    associatedtype PromiseWrapper : WebcomWrapper where Self == Self.PromiseWrapper.Wrapped
  • The wrapping instance, which has a PromiseKit-based API.

    Declaration

    Swift

    var forPromises: PromiseWrapper { get }