Create fulfill function for void promises

I find it annoying to have to add a Void value every time I need to fulfill a Void promise. It can also be confusing how to fulfill Void promises for people who are not familiar with how to instantiate a Void value.
This commit is contained in:
Lars Stegman 2018-11-29 10:14:24 +01:00
parent 5c8516a1ce
commit 33e7eba60b

View File

@ -65,6 +65,11 @@ extension Resolver where T == Void {
fulfill(())
}
}
// Fulfills the promise
public func fulfill() {
self.fulfill(())
}
}
#endif