Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 2af960a

Browse files
author
Alan Shaw
committed
docs: update repo.gc API doc
1 parent 2c643d7 commit 2af960a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

SPEC/REPO.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ Where:
2020

2121
| Type | Description |
2222
| -------- | -------- |
23-
| `Promise<Array>` | An array of objects |
23+
| `AsyncIterable<Object>` | An async iterable that yields objects describing nodes that were garbage collected |
2424

25-
each object contains the following properties:
25+
Each yielded object contains the following properties:
2626

27-
- `err` is an Error if it was not possible to GC a particular block.
27+
- `err` is an `Error` if it was not possible to GC a particular block.
2828
- `cid` is the [CID][cid] of the block that was Garbage Collected.
2929

3030
**Example:**
3131

3232
```JavaScript
33-
const res = await ipfs.repo.gc()
34-
console.log(res)
33+
for await (const res of ipfs.repo.gc()) {
34+
console.log(res)
35+
}
3536
```
3637

3738
#### `repo.stat`

0 commit comments

Comments
 (0)