Provide callback to useState hook like setState

Provide callback to useState hook like setState

  • December 15, 2020

If you have been writing class components for a while, you might be familiar with the callback functionality that the setState function provides. setState allows a second parameter to be passed to it as a callback. The callback function is invoked whenever the state of the function gets updated. But,...

Resolving nested queries in GraphQL

Resolving nested queries in GraphQL

  • December 8, 2020

When creating a GraphQL server with relational data, we want to return the data in a hierarchical format with those relationships in a single query. After all, that is where GraphQL comes in handy, right? Let us look into how we can do this using nested queries in GraphQL. This...

Creating a GraphQL API with Apollo Server

Creating a GraphQL API with Apollo Server

  • December 2, 2020

One of the many complaints about the GraphQL ecosystem is that there is a lot of indirection around what packages to use to create a GraphQL application. Even after selecting one, there is a lot of boilerplate code that one must create to make a GraphQL server work. While that...

How to unit-test a private (non-exported) function in JavaScript

How to unit-test a private (non-exported) function in JavaScript

  • November 19, 2020

When writing unit-tests for JavaScript modules, we often encounter a dilemma wherein the module has some private functions that have not been exported. Testing a function that has been exported is easy since it can be imported in the unit testing framework, and the functionality can be tested. But how...

Detecting click outside component using React hooks

Detecting click outside component using React hooks

  • November 10, 2020

If you have tried developing your own dropdown, modal, or popover in React, you would have come across this. “How do I detect a click outside my react component so that I can close it?” Detecting click outside component is luckily is not that difficult. This post will use react...

Recurrent Neural Networks

Recurrent Neural Networks

  • October 27, 2020

In this article, we will explore recurrent neural networks. For all the readers who are not versed with the concept of neural networks, I will recommend that you go through one of our previous articles and get a basic understanding of how a neural network works. Disclaimer – The concepts...