roblox-lua-promise v4.0.0 Release Candidate 2
Pre-release
Pre-release
[4.0.0-rc.2] - 2022-01-02
Fixed
- Fix bug where Promise.fold does not return correct value if there is an unresolved Promise in the passed list (#77)
[4.0.0-rc.1] - 2021-12-28
Changed
Promise:finallyno longer observes a rejection from a Promise. CallingPromise:finallyis mostly transparent now.- The Promise returned by
Promise:finallyresolves or rejects with whatever the parent Promise resolved or rejected with. It will be cancelled if the parent Promise is cancelled. - The value returned from the
finallyhandler is discarded now. - If the value returned from the
finallyhandler is a Promise, we wait for it to resolve, but we do not use its value. - If the value returned from the
finallyhandler is a Promise and it rejects,finallyreturns the new rejected value.
- The Promise returned by
Promise:finallyno longer counts as a consumer of the parent Promise for cancellation purposes. If all consumers are cancelled and the only remaining callbacks are finally handlers, the Promise is now cancelled.- The Promise executor thread is now closed with
coroutine.closewhen the Promise is cancelled. - The Promise executor thread is now closed after the Promise settles (calling
resolveorreject). - Callbacks enqueued with
andThenandcatchare now dequeued if the Promise returned byandThen/catchis cancelled. - Calling
andThenorcatchon an already-cancelled Promise now returns a cancelled Promise instead of returning a rejected Promise :await,:expect, and:awaitStatusare no longer backed by BindableEvents, and now use the task library directly, so performance should be better.