Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class Promise<Value> {
internal var state: State<Value> = .pending
internal let stateQueue = DispatchQueue(label: "com.mokasw.promise")
private var body: Body?
private(set) var context: Context = Context.custom(queue: .background))
private var observers: [Observer<Value>] = []
internal var bodyCalled: Bool = false
public init(in context: Context? = nil, _ body: @escaping Body) {
self.state = .pending
self.context = context ?? Context.custom(queue: .background))
self.body = body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.