How to detect location hash changes in Javascript
Introduction To detect the browser location hash changes in Javascript, there’s a web API event called hashchange. Which we can rely on to detect the change in…
Conditionally add a new property to JS objects
Introduction Recently, I published an article about How to spread objects in Javascript conditionally. This article won’t have much difference from the previous one, it rather demonstrates…
How to conditionally spread objects in Javascript
Introduction In Javascript, If we want to spread an object into another one, we usually use the spread syntax operator (…) to do so. Like the following:…
How to dynamically inject JS/CSS into a webpage
Introduction Working with the new frontend tech stacks is fun, however, in some cases, it might be challenging there’s a need to host the frontend application in…
How to auto-pull data in React-Query
Introduction React-Query is a powerful tool for fetching/caching the data on the frontend side, yet working with React-Query might be a bit not straightforward, in this article…
How to sort Javascript Set by value
The Set object lets you store unique values of any type, whether primitive values or object references. To sort a Set by value: Get an array of the Set’s entries using…
React-Query: How to fetch queries conditionally
Introduction React-Query is a powerful tool for fetching/caching the data on the frontend side, in this article we’re going to demonstrate how we can fetch the queries…
Understand Javascript Generators
Javascript generators are under-appreciated, yet they are actually very useful and powerful, in this article, we will explore the basics and the power of javascript generators. Introduction…