Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
export class Grid {
constructor(...drivers) {
this._drivers = drivers || [];
}
addDriver(driver) {
this._drivers.push(driver);
}
[Symbol.iterator]() {
this._index = 0;
return {
next: () => {
if (this._index == this._drivers.length) {
return { done: true };
}
return {
value: this._drivers[this._index++],
done: false
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.