[squeak-dev] Promise resolve

patrick.rein at hpi.uni-potsdam.de patrick.rein at hpi.uni-potsdam.de
Fri Dec 14 09:00:05 UTC 2018


Hi everyone,

during a project some students recently used Promise objects a lot. Due to the nature of the project, they often wanted to resolve a Promise without a value. As there is no #resolve method they resorted to `resolveWith: nil`. As this is rather ugly, I would like to propose an additional (convenience) method #resolve which simply resolves the Promise with the value nil. This would also mirror the #then: protocol as the resolve block does not have to accept the argument passed by the promise.

A downside of this proposal is that the protocol of Promise is currently quite lean and the method does not add anything substantial.

Bests
Patrick


More information about the Squeak-dev mailing list