How To Extend Express Request Interface in Typescript
| |

How To Extend Express Request Interface in Typescript

The problem You will likely be caught in this situation when you create middleware that processes the request data before it reaches the resource route. An example of this is JWT, where you will need to decode the token before every request, and put in the decoded data somewhere. In Javascript, it would have been…

6 Awesome Tricks with the Spread and Rest Operators in Typescript and Javascript Objects
| |

6 Awesome Tricks with the Spread and Rest Operators in Typescript and Javascript Objects

Introduction You may have seen this syntax in Typescript and Javascript Projects before: if you have used React, then you have very likely encountered this syntax a couple of times when passing the props from one component to another. The support for the spread and rest operators was added since: Typescript 2.1 and onwards Javascript…

Project Anchor Dev Log 1: The strength of being a technical and creative person
|

Project Anchor Dev Log 1: The strength of being a technical and creative person

When I set out to develop my own creative writing app, I really didn’t know what I signed myself up for. I didn’t have any prior knowledge in APIs, databases, ORM, React, ES6 Javascript, Typescript, and the list keeps going. The best I could do at the time was create web forms through jQuery, and…

Cannot start React App after installing Storybook? Here’s how to fix it
| |

Cannot start React App after installing Storybook? Here’s how to fix it

The Problem When Starting React You may have come across this issue when starting your react app after installing storybook: which is one hell of a message to read! but this gist of it is this: React uses a specific version of babel-loader, which has been overriden by storybook. With an incompatible version installed, our…

How to Configure a Path Alias in a React Typescript App for cleaner imports
| |

How to Configure a Path Alias in a React Typescript App for cleaner imports

Introduction As your Typescript React project grows with everything neatly separated in their own folder, the importing processes starts to become messy. This is specially true if we are following a project structure like react-bulletproof. Problem Your project strucure may look like this: and for us to import Button.tsx in TodoItem.tsx, our import statement will…

Sorting An Array of Strings in Typescript and Javascript
| |

Sorting An Array of Strings in Typescript and Javascript

Earlier, we learned how to filter an array in Typescript/Javascript. and now, we will have a quick look over Array.sort() in typescript and javascript. While what we will learn here is simple, it will be the foundation we need for our coming tutorials! Sorting Strings in Javascript / Typescript So we’d have this array: Javascript…

How to filter an array of objects in Typescript, the easy way
|

How to filter an array of objects in Typescript, the easy way

Filtering is something that you would often do in your Javascript and Typescript applications. We’ll be using Array.filter() to achieve this and to make the information more digestible, we will start with a simple array. Filtering an Array of Numbers so let us say we have an array of numbers and we want to filter…