Skip to content

Commit

Permalink
standardize context iteration error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
brainkim committed Apr 29, 2020
1 parent 72ad622 commit 855d62b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ class HostNode<T> extends ParentNode<T> {
*[Symbol.iterator]() {
while (!this.unmounted) {
if (this.iterating) {
throw new Error("You must yield something each iteration over context");
throw new Error("You must yield for each iteration of this.");
}

this.iterating = true;
Expand Down Expand Up @@ -837,7 +837,7 @@ class ComponentNode<T> extends ParentNode<T> {
*[Symbol.iterator](): Generator<Props> {
while (!this.unmounted) {
if (this.iterating) {
throw new Error("You must yield once per iteration over context");
throw new Error("You must yield for each iteration of this.");
} else if (this.componentType === AsyncGen) {
throw new Error("Use for await...of in async generator components.");
}
Expand All @@ -850,7 +850,7 @@ class ComponentNode<T> extends ParentNode<T> {
async *[Symbol.asyncIterator](): AsyncGenerator<Props> {
do {
if (this.iterating) {
throw new Error("You must yield once per iteration over context");
throw new Error("You must yield for each iteration of this.");
} else if (this.componentType === SyncGen) {
throw new Error("Use for...of in sync generator components.");
}
Expand Down

0 comments on commit 855d62b

Please sign in to comment.