View on GitHub

mini-swift

Minimal Flux architecture written in Swift.

EXTENSION

Promise

Properties

isIdle

var isIdle: Bool
  • Returns: true if the promise has not yet resolved nor pending.

isPending

var isPending: Bool
  • Returns: true if the promise has not yet resolved.

isCompleted

var isCompleted: Bool
  • Returns: true if the promise has completed.

isResolved

var isResolved: Bool
  • Returns: true if the promise has resolved.

isFulfilled

var isFulfilled: Bool
  • Returns: true if the promise was fulfilled.

isRejected

var isRejected: Bool
  • Returns: true if the promise was rejected.

value

var value: T?
  • Returns: The value with which this promise was fulfilled or nil if this promise is pending or rejected.

error

var error: Swift.Error?
  • Returns: The error with which this promise was rejected or nil if this promise is pending or fulfilled.

Methods

init()

public convenience init()

==(_:_:)

public static func == (_: Promise<T>, _: Promise<T>) -> Bool

Parameters

Name Description
lhs A value to compare.
rhs Another value to compare.

never()

public class func never() -> Promise<T>

==(_:_:)

public static func == (_: Promise<Never>, _: Promise<Never>) -> Bool

==(_:_:)

public static func == (lhs: Promise<T>, rhs: Promise<T>) -> Bool

notify(to:)

func notify<T: StoreType>(to store: T)