In javascript we sometimes have to deal with large sets of data that come in asynchronously.
Two tools we can use to do this are streams and generators.
Generators yield data, and continue logic after each yielded item is consumed.
I've been enjoying some posts on dev.to about blogging style, so I wanted to briefly write about my dead simple setup that vibes with my coding style.
Today I gave kubernetes a shot for the first time. I was interested in it's auto-restart feature, so I wrote a simple node.js program
In javascript we often need to do multiple asynchronous things.
I'd like to use this post to show a few examples of doing things serially, and in parallel with promises.
Typescript is great for developer experience.
You get real-time feedback about the validity of your code, and self documenting code via type-annotations. Also, the auto-complete and jump to definition features are game changing for speed.
In Typescript you write logic in terms of types. Sometimes you need to write logic that is valid for multiple types. One common example is an Array. You can have an Array of any type of thing.
Array<string>
Array<number>
Array<Array<number>>
Array<{name: string}>
Did you know you can add properties conditionally to an object with spread?
Destructuring is great for referencing pieces of objects or arrays. I find it to be very useful, and fun.