Releases: Byloth/core
v1.1.6
Patch release
- Improved compatibility for
DeferredPromise
class with nativePromise
class. - You can now use method
watch
onDeferredPromise
objects, so they can be resolved / rejected by otherPromise
objects.
This works likePromise.any
: the firstPromise
that resolves / rejects is considered; all others are discarded.
v1.1.5
v1.1.4
v1.1.3
v1.1.2
Patch release
Inverted the logic for the DeferredPromise
class:
Think about it... 🤔
A standard Promise
is something that -whoever initialize it- knows exactly when it will resolve (or reject) and other people are waiting for that to happen...
The 'Deferred Promise', on the other hand, allows the other to resolve it (or reject it) whenever he wants; whoever initializes it will never know exactly when it will happen.
BUT... This class is designed to allow the initializer to define exactly what will happen when it resolves (or rejects).
Because of this, this class now allows you to define onFulfilled
and onRejected
callbacks directly in its constructor.
You will no longer be able to define the usual executor
like the other Promise
; to do this, you can simply write the code outside or wherever you want (unless you have the DeferredPromise
instance handy).
v1.1.1
v1.1.0
v1.0.4
Patch release
- Extracted
Exception
class from@byloth/exceptions
package and included in@byloth/core
. - Implemented a new
Subscribers
class with which to implement the publish/subscribe pattern. - Enhanced
DeferredPromise
with the corrected return type forthen
,catch
andfinally
methods.