@soundworks/core
Advanced tools
Comparing version 4.0.0-alpha.13 to 4.0.0-alpha.14
{ | ||
"name": "@soundworks/core", | ||
"version": "4.0.0-alpha.13", | ||
"version": "4.0.0-alpha.14", | ||
"description": "Open-source creative coding framework for distributed applications based on Web technologies", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -121,5 +121,14 @@ /** | ||
* the collection. | ||
* @param {Function} executeListener - execute the callback with the states | ||
* already present in the collection. | ||
* @returns {Function} - Function that delete the registered listener. | ||
*/ | ||
onAttach(callback) { | ||
onAttach(callback, executeListener = false) { | ||
if (executeListener === true) { | ||
this._states.forEach(state => callback(state)); | ||
} | ||
this._onAttachCallbacks.add(callback); | ||
return () => this._onAttachCallbacks.delete(callback); | ||
} | ||
@@ -132,5 +141,8 @@ | ||
* from the collection. | ||
* @returns {Function} - Function that delete the registered listener. | ||
*/ | ||
onDetach(callback) { | ||
this._onDetachCallbacks.add(callback); | ||
return () => this._onDetachCallbacks.delete(callback); | ||
} | ||
@@ -193,3 +205,3 @@ | ||
/** | ||
* Iterable API for use in `for .. of` loops | ||
* Iterable API, e.g. for use in `for .. of` loops | ||
*/ | ||
@@ -196,0 +208,0 @@ [Symbol.iterator]() { |
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
353330
9246