-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ The
Pledge
class is now a child of Placeholder
and no longer a…
…n `Informer`
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ const SCHEDULE_EXECUTOR = Symbol('schedule_executor'), | |
* @since 0.8.15 | ||
* @version 0.8.15 | ||
*/ | ||
const AbstractPledge = Fn.inherits('Informer', function AbstractPledge(executor) {}); | ||
const AbstractPledge = Fn.inherits('Develry.Placeholder', '@', function AbstractPledge(executor) {}); | ||
|
||
AbstractPledge.setStatic('RESOLVED_VALUE', RESOLVED_VALUE); | ||
|
||
|
@@ -829,6 +829,24 @@ Pledge.setMethod(function _addProgressPledge(pledge) { | |
}; | ||
}); | ||
|
||
/** | ||
* Get the resolved value of this pledge. | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.9.0 | ||
* @version 0.9.0 | ||
* | ||
* @return {*} | ||
*/ | ||
Pledge.setMethod(function getResolvedValue() { | ||
|
||
if (this[STATE] != RESOLVED) { | ||
return this; | ||
} | ||
|
||
return this[RESOLVED_VALUE]; | ||
}); | ||
|
||
/** | ||
* Resolve with the given value | ||
* | ||
|