-
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement methods
andthen
and orelse
on Promise
The methods are intended to simplify conditional processing and chaining of kept or broken promises when used instead of the `then` method. `andthen` is fired only when its invocant promise is kept. If the invocant is broken then its cause becomes the cause of the promise returned by `andthen`: `orelse` is fired if its invocant is broken. If the invocant is kept then the promise returned by `orelse` is kept with invocant's result: If the invocant of `orelse` is broken the purpose of the method is to intercept the cause, handle it, and return a value to be used as the result of `orelse`-returned promise:
- Loading branch information
Showing
1 changed file
with
55 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters