I don't like to re-implement always the same code, so I collect snippets and share them with everyone!
8 posts
Most of the times primitive types are too generic, and this can cause problems. Learn how to properly validate your models and make your app completely type-safe.
Local storage database implementation in typescript with schema validation and error handling, using functional programming (fp-ts) and zod.
Function used to check if a variable is not nullable and narrow its type using Typescript.
React hook used to store, update, and validate data using functional programming with fp-ts.
A pure function that allows you to shuffle an array using functional programming with fp-ts in Typescript.
A pure function that allows to update all the elements in an array that are equal to a given equality check.
Execute a function after a timeout every time your data changes. Reset the timer if the data changes again during the timeout.
Abstraction for storing a number value that can be incremented and decremented by a given amount of steps.