-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
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?
firstly {
Promise.value(1)
}.then { _ in
Promise.value(2)
}.then { value in
if value > 0 {
Promise.value(3)
} else {
Promise.value(4)
}
}.done {
print($0)
}
Metadata
Metadata
Assignees
Labels
No labels