CLASS
Promise
public final class Promise<T>: PromiseType
Properties
result
public var result: Result<T, Swift.Error>?
Methods
value(_:)
public class func value(_ value: T) -> Promise<T>
error(_:)
public class func error(_ error: Swift.Error) -> Promise<T>
init(error:)
public init(error: Swift.Error)
init()
public init()
idle(with:)
public class func idle(with options: [String: Any] = [:]) -> Promise<T>
pending(options:)
public class func pending(options: [String: Any] = [:]) -> Promise<T>
fulfill(_:)
public func fulfill(_ value: T) -> Self
- Note:
fulfill
do not trigger an object reassignment, so no notifications about it can be triggered. It is recommended to call the methodnotify
afterwards.
reject(_:)
public func reject(_ error: Swift.Error) -> Self
- Note:
reject
do not trigger an object reassignment, so no notifications about it can be triggered. It is recommended to call the methodnotify
afterwards.
resolve(_:)
public func resolve(_ result: Result<T, Error>?) -> Self?
Resolves the current
Promise
with the optionalResult
parameter.
- Returns:
self
ornil
if noresult
was not provided.- Note: The optional parameter and restun value are helpers in order to make optional chaining in the
Reducer
context.
dynamicallyCall(withKeywordArguments:)
public func dynamicallyCall<T>(withKeywordArguments args: KeyValuePairs<String, T>)