readiness-manager
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "readiness-manager", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "👨💼 Define when your app is ready", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -28,3 +28,3 @@ const { | ||
/** | ||
* @type ReadinessManager | ||
* @type {ReadinessManager} | ||
*/ | ||
@@ -82,2 +82,3 @@ class ReadinessManager { | ||
* Runs current registered beacons execution to determine process "ready" state. | ||
* @return {ReadinessManager} | ||
*/ | ||
@@ -89,2 +90,4 @@ run() { | ||
.map(this[Symbols.execute]); | ||
return this; | ||
} | ||
@@ -95,2 +98,3 @@ | ||
* @param {ReadyCallback} callback | ||
* @return {ReadinessManager} | ||
*/ | ||
@@ -100,6 +104,8 @@ onReady(callback) { | ||
// Invokes immediately given callback if process is already ready. | ||
return callback(); | ||
callback(); | ||
return this; | ||
} | ||
this[Symbols.callbacks].push(callback); | ||
return this; | ||
} | ||
@@ -111,2 +117,3 @@ | ||
* @param {ReadyCallback} callback - The callback to run upon beacon resolved. | ||
* @return {ReadinessManager} | ||
*/ | ||
@@ -123,2 +130,3 @@ onActionReady(name, callback) { | ||
this[Symbols.beacons][name].callbacks.push(callback); | ||
return this; | ||
} | ||
@@ -129,5 +137,7 @@ | ||
* @param {ActionErrorHandler} errorHandler - The handler to trigger upon action errors. | ||
* @return {ReadinessManager} | ||
*/ | ||
onError(errorHandler) { | ||
Object.assign(this, { [Symbols.errorHandler]: errorHandler }); | ||
return this; | ||
} | ||
@@ -134,0 +144,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14515
10
284