In this post, we're going to take a look at another huge improvement that was introduced in React 16 called Fragments. What Fragments enables us to do is to return multiple children from a component. This is a big deal because in the pre-react 16 era you could only return…
If you've worked with streams you've probably played around with the Collectors class. In earlier posts I've looked at how you can accumulate elements of a stream using Collectors as well as looking at how you can create a custom collector. In this post we're going to take a look…
In this post we're going to take a look at a new data structure introduced in ES6 called Map. The Map data structure is probably familiar to most people out there, either from other languages or the similarities to the JavaScript object literal. Now let's dive into how JavaScripts version…
When writing asynchronous code using CompletableFuture you can quickly end up in a scenario where you can't wait for a given task to finish. You simply need to timeout and move on. This is something that has been addressed in Java 9 by introducing two new functions — orTimeout() and completeOnTimeout(…
Working with collections in Java has always been a bit of a hassle — especially if you want to initialise the collection and add data to it in one go. Where other languages got handy one-liners, the java coder had a way more cumbersome job ahead by first having to initialise…
The amount of things some people get done seems endless. You start to calculate the hours and it doesn't add up. What is their secret? How are they getting so much done? We all got the same 24 hours a day limitation. I've always been fascinated by productive people. I've…
In this post we're going to look at PureComponents in React. So what is a PureComponent? A PureComponent is just the same as a normal react component except for one thing — the implementation of shouldComponentUpdate. A PureComponent only does a shallow comparison of the props and state to decide if…
From time to time you end up with the need of generating some random numbers. In Java, the Random class has been the go-to solution for this type of work. Random serves several helpful methods for creating random ints, doubles and longs. However, if you wanted a sequence of random…