Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Hydra_Internals_6.swift
let onResolve = Observer<Value>.onResolve(ctx, { value in
do {
let chainedPromise = try body(value)
let pResolve = Observer<N>.onResolve(ctx, resolve)
let pReject = Observer<N>.onReject(ctx, reject)
chainedPromise.add(observers: pResolve,pReject)
chainedPromise.runBody()
} catch let error {
reject(error)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment