Skip to content

v2.0.0

Compare
Choose a tag to compare
@stakach stakach released this 06 Jan 23:01
· 23 commits to master since this release

The previous version required that promise values were nilable.
i.e. Promise.new(String) == Promise::DeferredPromise(String?)

This is no longer the case
Promise.new(String) == Promise::DeferredPromise(String)

This was achieved by:

  1. Using a proc to isolate the return value of the promise callbacks
  2. Using macros to differentiate between promise and regular return values without creating a union type
  3. Detecting NoReturn where a callback always raises and creating a Promise::DeferredPromise(Nil) for this case

Otherwise the library functions exactly as before.