How To Use Async Await in React (componentDidMount Async)

How to use Async Await in React?

How To Use Async Await in React

You want to use Async Await in React the same as you do in Node.JS?

create-react-app supports async/await out of the box.

But if you work with your own webpack boilerplate you may hit regeneratorRuntime is not defined.

If you’re hitting that error and you want to use Async Await in React, look no further.

Continue reading “How To Use Async Await in React (componentDidMount Async)”

How to Throw Errors From Async Functions in Javascript? (and how to test them)

It is possible to throw errors from async functions in Javascript?

How to Throw Errors From Async Functions in Javascript? (and how to test them)

The topic has been covered hundred of times but let’s see it from a TDD standpoint.

Answer the question without looking at Stackoverflow.

If you know the answer, well I’m impressed.

If not that’s cool too. Keep reading and you’ll find it!

Continue reading “How to Throw Errors From Async Functions in Javascript? (and how to test them)”

Webpack 4 Tutorial: from 0 Conf to Production Mode

webpack 4 is out!

The popular module bundler gets a massive update.

webpack 4, what’s new? A massive performance improvement, zero configuration and sane defaults.

webpack 4 logo

This is a living, breathing introduction to webpack 4. Constantly updated.

You’ll build a working webpack 4 environment by following each section in order.

But feel free to jump over the tutorial!

Continue reading “Webpack 4 Tutorial: from 0 Conf to Production Mode”

Django: How to Fix “missing 1 required positional argument: on_delete”

A quick fix for missing 1 required positional argument: on_delete on Django 2.0

Django 2.0: a quick fix for "missing 1 required positional argument: on_delete"

Django 2.0 has been released with some nice improvements over the older version.

I really like the new path method so I decided to check out Django 2.0. Among the new feature there are some minor changes such as with the ForeignKey field.

Continue reading “Django: How to Fix “missing 1 required positional argument: on_delete””

Tutorial: User Interface Testing with Jest and Puppeteer

I started to consider testing with Jest and Puppeteer right after the library came out. Puppeteer has quite an interesting API.

Testing with Jest and Puppeteer

In the following post I’ll introduce you to a basic UI test for a contact form.

We will testing with Jest and Puppeteer. Even if it’s still under development and the API could be subject to changes, Puppeteer is here to stay.

Continue reading “Tutorial: User Interface Testing with Jest and Puppeteer”

4 + 1 ways for making HTTP requests with Node.js: async/await edition

HTTP requests with Node.js are a means for fetching data from a remote source. It could be an API, a website, or something else: at one point you will need some code to get meaningful data from one of those remote sources.

4 + 1 ways for making HTTP requests with Node.js: async/await edition

During your career as a Web Developer you will work with HTTP requests all the time. This is why in the following post I want to introduce you to some different ways for making HTTP requests in Node.js.

Starting from the easier one we will explore the “classic way” for doing HTTP requests all the way through libraries which support Promises.

Continue reading “4 + 1 ways for making HTTP requests with Node.js: async/await edition”