…using logic wherever possible. For instance, you can use this technique to create a reusable loader indicator or an animated transition effect that should be triggered by certain events. A Loading Indicator HOCThe first example is a loading indicator built using HOC. It checks whether a particular prop is empty,…
…using a JavaScript function. If you want, you can actually use React.createClass, or the class syntax itself. Do whatever you like. But I like using stateless functions as much as possible.This is going to take one parameter, which is our props object, but it's going to have name and handle…
…using this pattern. This includes protected routes, creating a configurable generic container, attaching a loading indicator to a component, etc. In this tutorial, we will have a look at some best practices and dos and don'ts that you should look into while writing HOCs. IntroductionReact previously had something called Mixins,…
…using their credentials, a JSON Web Token is obtained and saved in local storage. Whenever the user wants to access a protected URL, the token is sent in the header of the request. The server then checks for a valid JWT in the Authorization header, and if found, the user…
…using mojs. In the second tutorial, we moved on to animation of built-in SVG shapes using the Shape module. The third tutorial covered more ways of animating SVG shapes using the ShapeSwirl and stagger modules.Now, we will learn how to animate different SVG shapes in a burst formation using the…
…using FTP or have the code pushed into a GitHub repo, whereas others prefer a deployment tool to make the process easier. One such tool that makes PHP deployment a breeze is Laravel Forge. Don't let the Laravel brand name mislead you. Apart from Laravel, you can use the service…
…using Object.assign in this way.So what we're going to do to tidy things up is create a new function called sendDelta. In this case, delta is just the term for whatever needs to change between this to-do and the new to-do that we need. So what we can do here…
…using two awesome Python packages: requests for fetching web pages and BeautifulSoup for parsing HTML pages.Installing Requests and BeautifulSoupInstall pipenv first, and then: pipenv install requests beautifulsoup4 This will create a virtual environment for you too. If you're using the code from gitlab, you can just pipenv install.Fetching PagesFetching a…
…using CamanJS in your own projects. Creating New Blend ModesBy default, CamanJS offers ten blend modes. These are normal, multiply, screen, overlay, difference, addition, exclusion, softLight, lighten, and darken. The library also allows you to register your own blend modes. This way, you can control how the corresponding pixels of…
…using just CSS. This could be very helpful in situations where you want to show the grayscale, blurred, or high-contrast version of the same image. Instead of creating four different images, you could just apply these effects to the original image using a few lines of CSS. Using CSS filters…