“href” vs. “src” in HTML

Last night, I vented out my frustration on <link> requiring href to point to a CSS stylesheet instead of src. I will share the help I received and the history…

July 18, 2019
👉

How to use TSDX

A Zero-configuration CLI (command line interface) for creating a TypeScript library Photo by solmaz hatamian on Unsplash After migrating react-use-localstorage to TSDX, I wanted to share what TSDX is and how to use…

June 17, 2019
👉

Promise.race vs. Promise.any And Promise.all vs. Promise.allSettled

Photo by Ryan Franco on Unsplash What’s new in JavaScript (Google I/O ’19) on May 8, 2019 showed what’s coming/available for static Promise combinator methods, Promise.allSettled and Promise.any. There are already two methods…

May 18, 2019
👉

Scrolling with Page Up/Down Keys in React-Window

Photo by Ruthie on Unsplash React-Window is a React library by Brian Vaughn for rendering a massive amount of items in a list (or a grid but I will use “list” to…

May 08, 2019
👉

Two gotchas in Chrome Developer Tool Console

Photo by Jason Leung on Unsplash There are two surprising behaviors on Chrome Developer Tool Console (“console” hereafter). First one was pointed out by my friend Nicolas Marcora that you can await…

April 20, 2019
👉

Adding numbers using Boolean operations in JavaScript

Photo by Crissy Jarvis on Unsplash You know how to add numbers progmatically, right? 1 + 1 will basically give you 2. Numbers are added in binary form down in machine level.…

April 14, 2019
👉

Spread syntax gotcha in JavaScript class methods

Photo by Jay on Unsplash – Don’t get caught Watch out when exposing a mutable data structure with React Hooks When you spread an object instance of a class to expose methods,…

March 30, 2019
👉

@cshooks/usetrie, A React Hook for Typeahead/Autocomplete

Photo by Jamie Street on Unsplash – “trie” is from “Retrieval” thus the cute 🐶 “Retriever” I’ve released @cshooks/usetrie. It’s a React Hook for Typeahead/autocompletion. @cshooks/hooks will be the home 🏠 of Computer…

March 23, 2019
👉

Emoji Error in Chrome Extension HTML

Photo by Bernard Hermant on Unsplash I’ve had a problem where I was trying to display an Emoji in a Chrome Extension header of default popup HTML, page_action.html (specified by page_action -> default_popup…

February 17, 2019
👉

Being explicit with your own React Hook + TypeScript return type

Photo by Rafaela Biazi on Unsplash TheAifam5 graciously reported an issue for react-use-localstorage that even though it was written using TypeScript, it wasn’t distributing TypeScript type declaration file. react-use-localstorage is a React Hook…

February 10, 2019
👉

Getting DOM content from Chrome Extension

Photo by Sai Kiran Anagani on Unsplash Note to self on how to get DOM content from Chrome Extension As I was building a Chrome Extension, Easy GitHub to generate I had to…

February 10, 2019
👉

Dynamically build TypeScript string literal type

Photo by Kevin Jarrett on Unsplash TypeScript has String Literal Types, which lets you specify what string value is allowed for a variable.You can specify the allowed literal values during type declaration. When…

February 02, 2019
👉

Default Class Access Modifier Differences between TypeScript & C#

Photo by Patrick Fore on Unsplash Note to self… TypeScript’s class access modifiers are public by default while it’s private in C#. Quite a surprise as TypeScript was created by Anders Hejlsberg, who…

January 25, 2019
👉

React + TypeScript with Parcel

Photo by Kira auf der Heide on Unsplash Learned today that it’s easy to create React + TypeScript site with Parcel without using CRA (create-react-app). Parcel Documentation has a whole (short but complete)…

January 23, 2019
👉

Living on the edge with “dangerous”

As I’ve been using Styled Components (SC hereafter) and been wondering about the magic behind it. Thankfully, Max Stoiber (a creator of SC) has written an article, The magic behind…

January 13, 2019
👉