Skip to content

Commit 63ca62c

Browse files
cubehouseclaude
andcommitted
docs(entity): class-level JSDoc on walk()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 95eff96 commit 63ca62c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/ergonomic/entity.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ export class EntityHandle {
3737
return this.raw.getEntityLive(this.id);
3838
}
3939

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+
*/
4049
async *walk(): AsyncIterable<EntityChild> {
4150
const res = await this.raw.getEntityChildren(this.id);
4251
for (const child of res.children ?? []) {

0 commit comments

Comments
 (0)