Skip to content

Instantly share code, notes, and snippets.

@evilpie
Last active June 13, 2021 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evilpie/9a8919cf4bdb51acaecf036997c2592e to your computer and use it in GitHub Desktop.
Save evilpie/9a8919cf4bdb51acaecf036997c2592e to your computer and use it in GitHub Desktop.
var stream = new ReadableStream({
start(controller) {
controller.enqueue("abc");
controller.enqueue("123");
controller.close()
}
});
var reader = stream.getReader();
reader.read().then(({ value, done}) => {
console.log(value);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment