Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
cool
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Oct 2, 2023
1 parent 754ae67 commit 938d578
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .rfcs/001-serialize-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ const out = [
#### Emitting

```js
async function* stringifyAsync() {}
async function* asyncStringify() {
// see further down for idea of implementation
}

const response = null;
const data = {
promise: Promise.resolve(42),
};

for await (const chunk of stringifyAsync(data)) {
const [head, iterator] = asyncStringify(data);
response.write(head);
for await (const chunk of asyncStringify(iterator)) {
response.write(chunk);
}
```
Expand Down

0 comments on commit 938d578

Please sign in to comment.