Context

Often, a hook is going to need a value out of context. The useContext hook is really good for this, but it will often require a Provider to be wrapped around the component using the hook. We can use the wrapper option for renderHook to do just that.

Let’s change…


Optimize your pages for instant loads when using the browser’s back and forward buttons.

Back/forward cache (or bfcache) is a browser optimization that enables instant back and forward navigation. It significantly improves the browsing experience for users-especially those with slower networks or devices.

As web developers, it’s critical to understand…


Deep dive into JavaScript console API

The Console method log() outputs a message to the web console. The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects. console.logis one of JavaScript’s most straightforward approach to troubleshoot anything. …


A quick overview to Jest, a test framework for Node.js. This guide targets Jest v23+.

Quick start

npm install --save-dev jest babel-jest/* Add to package.json */
"scripts": {
"test": "jest"
}
# Run your tests
npm test -- --watch

--coverageSee a summary of test coverage
--detectOpenHandlesSee a summary of ports that didn’t…


I have a micro front end where I want to communicate between a React component and an angular component built by some other team where they listen to a custom event. My team using react and jest as testing framework.

Now I have to create and test a component that…


I wrote an article about IIFE (JS — Immediately Invoked Function Expression) if you want to read about it. IN this article, I will explain the scenarios when you need to use IIFE.

The most common use cases for IIFEs are:

  • Aliasing global variables
  • Creating private variables and functions
  • Asynchronous…


An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.

(function () {
// statements
})();
(() => {
// with fat arrow syntax
})();

It is a design pattern which is also known as a Self-Executing Anonymous Function and contains two…


It would be one of the most rewarding experiences, both financially and logically, buying and managing cryptocurrencies like Bitcoin, Litecoin, Ethereum. Like learning any other new tech, everyone make rookie mistakes along the way, but you will learn some best practices along the way. …


As I read more about Symbols, I get more questions and answers. So I thought, its important to know some facts about the Symbols. (you can read my original article about the Symbols here)

  1. The original motivation for introducing symbols to Javascript was to enable private properties.
  2. Symbols can be…

Symbols

Symbols are new primitive type introduced in ES6. Symbols are completely unique identifiers. Just like their primitive counterparts (Number, String, Boolean), they can be created using the factory function Symbol() which returns a Symbol. Symbols are incomplete as a constructor because it does not support the syntax new Symbol().

const…

Vinayak Hegde

Dad, Husband, Son, Brother, Coder (mostly JavaScript), micro-blogger

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store