Velocidad de Escape

Using AbortController in React

The use of <a class="hover:no-underline text-blue underline" href="https://developer.mozilla.org/en-US/docs/Web/API/AbortController" target="_blank" rel="noreferrer">AbortController</a> is helpful in situations where a network request needs to be canceled before it completes, such as when the user navigates to a different page or when a request needs to be interrupted that is taking too long to complete. `AbortController` provides a more flexible and precise way to cancel network requests. By creating an instance of `AbortController`, a **signal** can be generated that can be passed to a...

React

Built-in error objects in JavaScript

This morning I was improving a bit my blog, and I found this piece of code, this is simply a validation that I am doing on a component that I create for Astro: ```js if (typeof text !== "string") { throw new Error("text must be a string") } if (typeof maxLength !== "number") { throw new Error("maxLength must be a number") } if (typeof addEllipsis !== "boolean") { throw new Error("addEllipsis must be a boolean") } ``` `throw new Error` is not incorrect, but it is generic, the `TypeError` object is more specific and is commonly used for errors that occur when a value is not of the...

JavaScript

Being an Individual contributor in LATAM

Among my many pending tasks I had this one, writing a post talking about how difficult or impossible it is to be an Individual Collaborator in LATAM, but well, I finally decided, this may be an unpopular opinion, but in the end, it is my opinion... When I started studying programming, I really didn't know that many years later that would end up being my profession; I was about 14 years old and I liked to test things that I saw on internet forums (elhacker.net) for example. That was how it all started... Python was the first language I learned, although PHP was starting to take off and...

Personal

Dynamic classes in Tailwind

Yesterday I was playing with OpenAI (as usual), creating one of my many experiments, testing new prompts, etc. ## <a class="hover:no-underline text-blue underline" href="https://github.com/Angelfire/colorette" target="_blank" rel="noreferrer">Colorette</a> ![Colorette](https://user-images.githubusercontent.com/315504/218640623-ebb99f22-96bc-41c7-8ec4-c774cbf1a590.png) Basically the idea is to generate a color palette with a description and a title based on a series of words that we indicate to the AI, up to this point it looks like a fairly simple data structure: ```js type Color = { ...

CSS

TailwindCSS