@soundworks/core 4.0.0-alpha.11 → 4.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -186,6 +186,23 @@ class BaseSharedStateCollection {
|
|
|
186
186
|
find(func) {
|
|
187
187
|
return this._states.find(func);
|
|
188
188
|
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Iterable API for use in `for .. of` loops
|
|
192
|
+
*/
|
|
193
|
+
[Symbol.iterator]() {
|
|
194
|
+
let index = 0;
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
next: () => {
|
|
198
|
+
if (index >= this._states.length) {
|
|
199
|
+
return { value: undefined, done: true };
|
|
200
|
+
} else {
|
|
201
|
+
return { value: this._states[index++], done: false };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
189
206
|
}
|
|
190
207
|
|
|
191
208
|
export default BaseSharedStateCollection;
|