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:
parent
5c8516a1ce
commit
33e7eba60b
@ -65,6 +65,11 @@ extension Resolver where T == Void {
|
||||
fulfill(())
|
||||
}
|
||||
}
|
||||
|
||||
// Fulfills the promise
|
||||
public func fulfill() {
|
||||
self.fulfill(())
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user