We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95eff96 commit 63ca62cCopy full SHA for 63ca62c
1 file changed
src/ergonomic/entity.ts
@@ -37,6 +37,15 @@ export class EntityHandle {
37
return this.raw.getEntityLive(this.id);
38
}
39
40
+ /**
41
+ * Yield every descendant of this entity in a single API call.
42
+ *
43
+ * The ThemeParks API's `/children` endpoint returns the entire subtree in
44
+ * one response — this method just exposes it as an async iterator so
45
+ * callers can `for await` without flattening themselves. The root entity
46
+ * itself is not yielded. When the entity has no children (or the response
47
+ * omits the `children` array) the iterator completes without yielding.
48
+ */
49
async *walk(): AsyncIterable<EntityChild> {
50
const res = await this.raw.getEntityChildren(this.id);
51
for (const child of res.children ?? []) {
0 commit comments