Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Probs need to specify return type too: firstly {
Promise.value(1)
}.then { _ in
Promise.value(2)
}.then { value -> Promise<Int> in
if value > 0 {
return Promise.value(3)
} else {
return Promise.value(4)
}
}.done {
print($0)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is the below code possible? I am getting Error. Type '()' cannot conform to 'Thenable'; only struct/enum/class types can conform to protocols.
How do I achieve condition chaining inside then closure?
Beta Was this translation helpful? Give feedback.
All reactions