Using async generators to stream data in JavaScript

preview_player
Показать описание
🔗 Playlist for this series

🔗Code from the episode

🔗 (Patrons only) Official discussion topic for this episode on the Fun Fun Forum:

🔗 Support the show by becoming a Patreon

🔗 mpj on Twitter

🔗 Help translate the show to your language

We've been looking as async iterators and sync iterators in JavaScript but we've not yet looked at Async Generators, which is honestly what I've been building up to! Async Generators in JavaScript are pretty amazing.
Рекомендации по теме
Комментарии
Автор

That "pageIndex = pageIndex +1" line made me vomit a little lol

tommytomtomtomestini
Автор

Really hyped about higher order async iterables!

DrempDK
Автор

One of my favorite videos so far! This whole iterators and generators series has been extremely useful to me

mserrano
Автор

Where I am in the bootcamp I am attending these videos are very valuable to me! Can't wait for higher order async iterables!

SiriusScaper
Автор

4:13 that sound is killing me :D
Thanks, awesome video.

What about video around Proxy?

steveneeson
Автор

I like to think of the need for iterators as the freedon from the code structure, to peek a "register" whenever I want it:
In a loop, your actions are constraint to what you can do between the control line (for/while/do/etc.) and the end of the cycle, while an iterator can be use at any moment in your whole app, and treat each element of the data set in a very free dynamic way.

Автор

Good Monday morning! Great video! genuinely enjoying this series and looking forward to higher order async generators. Pretty much opened up my youtube channel to leave this comment.

sameedkhan
Автор

Awesome vid! I am going to go back and re watch the ramp up vids for this to get more out of it. Really cool to watch a full process! thanks!

qwarlockz
Автор

What's with the `function flickrTagSearch(tag, page)` defined inside the `function flickrTagSearch(tag)`?

severancestreet
Автор

Mpj. I can't thank you enough fir teaching me async generators

ajalbani
Автор

Hi Mpj!
I work with nodejs, where the concept of streams is already integrated into the language.
Since an async generator expresses the concept of streams, does make sense to use it in nodejs since the streams already exists? If yes, when?
Congratulations for the videos!

filippomenis
Автор

hmm, not sure if we can _replace_ rxjs/bacon/etc. with async iterators, becuase Rx streams are push-based and the streams you defined (async iterators) are pull-based. The nature is different. The difference is in who holds the control flow. In pull-based, the owner of the iterator controls how many items can be consumed (how many cat pictures can you see in a period of time in order to get satiscaftion), whereas in push-based the stream is an observable, so flow is inverted (IoC), the platform/lib controls it and invokes the subcriber automatically (the cat pictures change depending on the device and its settings). Both are iterators and both are async, they just differ in who holds the control: you (then it's good that you HAVE it under control), or the platform (IoC, then it's good that you DON'T HAVE to have control) ;)
In order to actually _replace_ RxJS with async iterators, you'd have to (1) re-implement all operators (just as rx did), (2) implement observable/observer pattern (just as rx did) so that the stream is lazy as long as nobody subscribed to it. So although you do have the low-level primitives in your hands, you'd have to reimplement the missing higher-level traits.

DucinDev
Автор

What is the editor/plugin that you use for writing the js code and getting a function result next to the line where it's executed?

Zieu
Автор

A thing close to infinity 5:55 the JavaScript infinity or the mathematical infinity ?

Luxcium
Автор

Hey MPJ!
Currently I'm translating subtitles of this video to Russian and on 0:40 you said "for loop provide iterator"? Am I right? If it's true, that's actually not correct, for loop do not have and cannot have iterator, but its using iterator in order to iterate over collection's items.

andreyshedko
Автор

Video suggestion: Proxy object in JavaScript, Vue 3 implementing his new engine with Proxies and IE slowly diyng will boost the usage of this feature.

alessiobreviglieri
Автор

Awesome stuff. Is it possible to use Async Generator with angular data tables. If No, What would be the alternative way to do it.

venkateshrajendran
Автор

By the way, all readable streams in Node.js 10 are async iterators! So we can:
for await (let c of fs.createReadStream(filename) { console.log(c) }

MaxDavydov-rk
Автор

I missed something or you removed your genious intro? :)

jakkk
Автор

You are a genius ... When I get $$$ I will become a patron. In the meantime please accept my rainbows and unicorns🌈🦄

awumsuri