Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you use the fetch API you can get a readable stream and party on without too much difficulty. You can also implement a transform stream in ~10SLOC that will make the reader vend parsed JSON objects and can be reused easily.


This is a good point. In fact, you just helped me realize that I can probably replace this[0] at work with a fetch implementation. ReadableStreams weren't generally available across browsers when I wrote that. This would also allow us to return binary data if we so desired (XHR can handle binary but it can't stream it chunk by chunk). Thanks!

[0]: https://github.com/anderspitman/xhr-stream-dl




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: