@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soundworks/core",
3
- "version": "4.0.0-alpha.11",
3
+ "version": "4.0.0-alpha.13",
4
4
  "description": "Open-source creative coding framework for distributed applications based on Web technologies",
5
5
  "authors": [
6
6
  "Benjamin Matuszewski",
@@ -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;