basically-streams
basically-streams copied to clipboard
An introductory project to the relatively new streaming APIs available in modern browsers.
Basically, Streams 🌊
So something (relatively) new and fun in browsers, are these two APIs: ReadableStream and WritableStream. 😮
What they allow you to do, is basically send and receive chunks of things progressively (that then combine into the final large thing), as opposed to moving around entire things from server -> browser -> user.
This is really cool.
Streams have some fancy bells and whistles that we'll get to talk about in this project. I'll list them below, but I'd highly recommend starting with the root-level project (index.html, index.js, index.css), and moving into the examples from there.
Why this project?
The answer to this question is basically the same answer to all the things in my "Basically" series: this project aims to explain streams to any level of developer: beginner, intermediate or advanced, focused primarly on the beginners.
The hope is that the concept of streams within a browser would not be scary, causing developers to shy away from it; but rather, that this concept would be dispalyed for how simple it really is, enabling developers to embrace it and run with it, allowing the creation beautiful, streamy things.
Examples
In the next few hours, I am to push examples of cool stream features, such as:
- (Really) Progressive Web Apps (Demo | Code)
- AJAX Requests with Streams (and progress bars) (Demo | Code)
- Piping Streams (Demo | Code)
- Backpressure (Demo | Code)
- Teeing (Forked streams) (Demo | Code)
If you'd like to contribute your use case or examples, pull requests are welcome! Wooo!