As humans, we crave for the connection of others, whether we realize it or not. As writers and content creators people want attention, they want to be noticed. At some point along the way many of us lost the desire to output authentic content, we stopped telling stories from the heart. Instead we began selling stories. We try to provide a catchy title in order to grab a potential reader’s attention, yet mostly have no real substance.
A few of my close friends Gabriel Chavez and Franklyn François started writing on Medium. They decided to try and make a difference. They decided to have a voice. They shared their raw thoughts and emotions. They have written on the themes of identity, shame, and about rejection. …
Generator are special functions that are new with ES6 / EcmaScript2015. Simply put, a Generator is a function whose execution is “pause-able and resume-able” meaning that it is not “run-to-completion”. This allows us to do some really cool things!
Generators allow us to do some really powerful things. Generators allow expensive computations to be simply split up and maintainable. They give us another way to write synchronous looking JavaScript which is actually asynchronous. Generators pave the way for the future of JavaScript with things like Async/Await.
In order to define a generator function we use the function* syntax, like so:
function* myGenerator1() {...} …
In the previous Asynchronous Adventure we discussed the idea/pattern of callbacks in JavaScript. The callback pattern is awesome! One of the drawbacks of the callback pattern is in order to handle sequential async behavior this often resorts in a code which becomes harder to read, debug, and maintain. This is often referred to as callback hell.
One way to manage asynchronous behavior that is often considered to be a leveled up version of the callback pattern is the Promise pattern.
Promises are not a new concept. In fact, they have been around since 1976, when the term was first coined.
In the JavaScript world, in the beginning of 2011, Promise concepts were made popular by jQuery Deferred Objects. Deferred Objects are conceptually similar to Promises, but they do not abide by the current ECMAScript 2015 spec for Promises. …
Incase you missed it, in the last Asynchronous Adventure, I covered Understanding the JavaScript Event Loop. Now let’s move on to the topic of callbacks. We couldn’t start talking about callbacks until we talk about how to define functions in JavaScript.
JavaScript is a powerful language that is eating the world of software development. One of the things that differentiates JavaScript from some of the more “traditional” C-like languages, is how it executes code.
For those unfamiliar with JavaScript, it is often described as having a single-threaded, event-driven, and non-blocking I/O model. This jargon-loaded phrase can be a confusing for those unfamiliar with the JavaScript runtime.
I know there are a lot of great examples and analogies of how the Event Loop works with JavaScript (in the Browser, and in Node), so I will try to break it down in as simply as possible. …
About