ProgressablePromise
public class ProgressablePromise<T> : AnyProgressablePromise
A wrapper around PromiseKit’s Promise class that supports progress callbacks.
-
The underlaying promise.
Declaration
Swift
public let promise: Promise<T> -
Creates a
ProgressablePromisefrom the given promise. Progress handlers are not suported when using this initlializer.Declaration
Swift
public convenience init(promise: Promise<T>)Parameters
promiseThe promise to wrap.
-
Creates a new
ProgressablePromiseusing the given resolver.The callback is given two parameters: a
Resolver<T>and aProgressHandler. The callback is expected to perform a task, while calling the progress handler on a regular basis and finally resolve the promise.Declaration
Swift
public convenience init(_ resolver: (Resolver<T>, @escaping ProgressHandler) throws -> Void)Parameters
resolverThe callback that perform the expected task.
-
Assign a progress handler to the promise that will be called each time an update to the progress is made.
Declaration
Swift
public func progress(_ handler: @escaping (Progress) -> Void) -> Promise<T>
ProgressablePromise Class Reference